From 145e02fc5444eb878f67c58e310e7c5e324bb27a Mon Sep 17 00:00:00 2001 From: obscuren Date: Sun, 26 Apr 2015 11:19:40 +0200 Subject: core, miner: added value check on tx validation * Changed CalcGasLimit to no longer need current block * Added a gas * price + value on tx validation * Transactions in the pool are now re-validated once every X --- core/transaction_pool_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/transaction_pool_test.go') diff --git a/core/transaction_pool_test.go b/core/transaction_pool_test.go index f96d2b651..4d66776f0 100644 --- a/core/transaction_pool_test.go +++ b/core/transaction_pool_test.go @@ -43,10 +43,11 @@ func TestInvalidTransactions(t *testing.T) { t.Error("expected", ErrInsufficientFunds) } - pool.currentState().AddBalance(from, big.NewInt(100*100)) + balance := new(big.Int).Add(tx.Value(), new(big.Int).Mul(tx.Gas(), tx.GasPrice())) + pool.currentState().AddBalance(from, balance) err = pool.Add(tx) if err != ErrIntrinsicGas { - t.Error("expected", ErrIntrinsicGas) + t.Error("expected", ErrIntrinsicGas, "got", err) } pool.currentState().SetNonce(from, 1) -- cgit v1.2.3