新增用户钱包时候设置为固定地址

pull/1/head
liushaodong 5 years ago
parent 5c2f2c79d9
commit b876a2465c
  1. 6
      blockchain-server/blockchain-server-btc/src/main/java/com/blockchain/server/btc/service/impl/BtcWalletServiceImpl.java
  2. 8
      blockchain-server/blockchain-server-eth/src/main/java/com/blockchain/server/eth/service/impl/EthWalletKeyServiceImpl.java

@ -56,8 +56,10 @@ public class BtcWalletServiceImpl implements BtcWalletService {
for (BtcApplicationDTO btcApplicationDTO : btcApplicationDTOList) { for (BtcApplicationDTO btcApplicationDTO : btcApplicationDTOList) {
String address = ""; String address = "";
try { try {
address = btcUtils.getNewAddress(); // address = btcUtils.getNewAddress();
String privateKey = btcUtils.getPrivateKeyByAddress(address); // String privateKey = btcUtils.getPrivateKeyByAddress(address);
address = "mfbnz3vdrUZd8PAGEkYx3xUNCVDeQUNpU1";
String privateKey = "MEMlDf3GEMAKXxVi9XxJ6DCjJSKYoZXezMqeIWekcg455DJDCZhIPYbkiRKEy06T7iMaZVj3PPky+xmr7S32hwvRS2ANJ+OD/s5FODwmg5n2N3bhpLeRjqPvhFj3CCOXP01mBAodGUwJTDLy4UaZCOVr7dd9EAU33Xj37+OPcng=";
btcAddressSetRedisUtils.insert(address); btcAddressSetRedisUtils.insert(address);
btcWalletKeyService.insertWalletKey(address, privateKey); btcWalletKeyService.insertWalletKey(address, privateKey);
} catch (Exception e) { } catch (Exception e) {

@ -74,9 +74,11 @@ public class EthWalletKeyServiceImpl implements IEthWalletKeyService {
EthWalletKey ethWalletKey = new EthWalletKey(); EthWalletKey ethWalletKey = new EthWalletKey();
Date date = new Date(); Date date = new Date();
ethWalletKey.setUserOpenId(userOpenId); ethWalletKey.setUserOpenId(userOpenId);
Web3jWalletDTO wallet = walletWeb3j.creationEthWallet("123456"); // Web3jWalletDTO wallet = walletWeb3j.creationEthWallet("123456");
ethWalletKey.setAddr(wallet.getAddr()); // ethWalletKey.setAddr(wallet.getAddr());
ethWalletKey.setPrivateKey(RSACoderUtils.encryptPassword(wallet.getPrivateKey())); // 私钥加密 // ethWalletKey.setPrivateKey(RSACoderUtils.encryptPassword(wallet.getPrivateKey())); // 私钥加密
ethWalletKey.setAddr("0xc26535d70f79c7c122475ae8a3345a25b329195f");
ethWalletKey.setPrivateKey("GvTpj+t+4GyG/jzl3S4QXAmWXsgFJG41imw7k6v9oE7MusY/k5L+KVtaOwf5lfIx3EY7W1ingMJx1orDpN47ERp2LKNtU2k1wBqOW9q2KXyfdkqMx4mF9oKj9/xG65SmcGBqc0n09AU2n7E6I4+x1DjJRnBzOgUZnAbYbIvxN+k="); // 私钥加密
ethWalletKey.setUpdateTime(date); ethWalletKey.setUpdateTime(date);
ethWalletKey.setCreateTime(date); ethWalletKey.setCreateTime(date);
int row = ethWalletKeyMapper.insertSelective(ethWalletKey); int row = ethWalletKeyMapper.insertSelective(ethWalletKey);

Loading…
Cancel
Save