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
This commit is contained in:
obscuren
2015-04-26 11:19:40 +02:00
parent 8d09f95bc7
commit 145e02fc54
5 changed files with 18 additions and 21 deletions

View File

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