Esempio n. 1
0
 @Override
 public void setSender(ECKey senderPrivateKey) {
   txSender = senderPrivateKey;
   if (!getBlockchain().getRepository().isExist(senderPrivateKey.getAddress())) {
     Repository repository = getBlockchain().getRepository();
     Repository track = repository.startTracking();
     track.createAccount(senderPrivateKey.getAddress());
     track.commit();
   }
 }
Esempio n. 2
0
 public byte[] getSender() {
   try {
     if (sendAddress == null) {
       ECKey key = ECKey.signatureToKey(getRawHash(), getSignature().toBase64());
       sendAddress = key.getAddress();
     }
     return sendAddress;
   } catch (SignatureException e) {
     logger.error(e.getMessage(), e);
   }
   return null;
 }