From 8677b77defbf956513105f0c13027dd110e30085 Mon Sep 17 00:00:00 2001 From: romanman Date: Wed, 4 Jun 2014 16:12:57 +0300 Subject: [PATCH] balance subtraction bug , found in the movie :) --- ethereumj-core/src/main/java/org/ethereum/core/Wallet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/core/Wallet.java b/ethereumj-core/src/main/java/org/ethereum/core/Wallet.java index 73f7b70f..de7da49f 100644 --- a/ethereumj-core/src/main/java/org/ethereum/core/Wallet.java +++ b/ethereumj-core/src/main/java/org/ethereum/core/Wallet.java @@ -89,8 +89,8 @@ public class Wallet { AccountState senderState = rows.get(Hex.toHexString(senderAddress)); if (senderState != null){ - BigInteger value = new BigInteger(transaction.getValue()); - senderState.addToBalance(value.negate()); + BigInteger value = new BigInteger(-1, transaction.getValue()); + senderState.addToBalance(value); senderState.incrementNonce(); }