Proceed sender value from the tx
This commit is contained in:
parent
0e239b58ef
commit
46eab0c807
|
@ -97,14 +97,14 @@ public class Wallet {
|
|||
|
||||
for (Transaction tx : transactions){
|
||||
|
||||
// byte[] senderAddress = tx.sender();
|
||||
// AddressState senderState = rows.get(Hex.toHexString(senderAddress));
|
||||
// if (senderState != null){
|
||||
// BigInteger value = new BigInteger(0, tx.getValue());
|
||||
//
|
||||
// senderState.addToBalance(value.negate());
|
||||
// walletUpdated = true;
|
||||
// }
|
||||
byte[] senderAddress = tx.sender();
|
||||
AddressState senderState = rows.get(Hex.toHexString(senderAddress));
|
||||
if (senderState != null){
|
||||
BigInteger value = new BigInteger(tx.getValue());
|
||||
|
||||
senderState.addToBalance(value.negate());
|
||||
walletUpdated = true;
|
||||
}
|
||||
|
||||
byte[] receiveAddress = tx.getReceiveAddress();
|
||||
AddressState receiverState = rows.get(Hex.toHexString(receiveAddress));
|
||||
|
|
Loading…
Reference in New Issue