Proceed sender value from the tx

This commit is contained in:
romanman 2014-05-21 18:16:21 +03:00
parent 0e239b58ef
commit 46eab0c807
1 changed files with 8 additions and 8 deletions

View File

@ -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));