diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-24 06:00:50 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-24 06:00:50 +0800 |
commit | 1c85d8c66b9db23687b0446b4a7e97e3e61fe188 (patch) | |
tree | 18b53dd3377e082d15185f1cb2c5d255975e0310 /ethchain/transaction_pool.go | |
parent | 0651af9dfd701ba09e6c734f21eff85f61454476 (diff) | |
download | dexon-1c85d8c66b9db23687b0446b4a7e97e3e61fe188.tar.gz dexon-1c85d8c66b9db23687b0446b4a7e97e3e61fe188.tar.zst dexon-1c85d8c66b9db23687b0446b4a7e97e3e61fe188.zip |
Minor improvements and bug fixes
* Fixed VM base bug
Diffstat (limited to 'ethchain/transaction_pool.go')
-rw-r--r-- | ethchain/transaction_pool.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ethchain/transaction_pool.go b/ethchain/transaction_pool.go index 957381ac7..91fad2635 100644 --- a/ethchain/transaction_pool.go +++ b/ethchain/transaction_pool.go @@ -100,6 +100,10 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, block *Block, toContract // Get the sender sender := block.state.GetAccount(tx.Sender()) + if sender.Nonce != tx.Nonce { + return fmt.Errorf("[TXPL] Invalid account nonce, state nonce is %d transaction nonce is %d instead", sender.Nonce, tx.Nonce) + } + // Make sure there's enough in the sender's account. Having insufficient // funds won't invalidate this transaction but simple ignores it. totAmount := new(big.Int).Add(tx.Value, new(big.Int).Mul(TxFee, TxFeeRat)) @@ -107,10 +111,6 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, block *Block, toContract return fmt.Errorf("[TXPL] Insufficient amount in sender's (%x) account", tx.Sender()) } - if sender.Nonce != tx.Nonce { - return fmt.Errorf("[TXPL] Invalid account nonce, state nonce is %d transaction nonce is %d instead", sender.Nonce, tx.Nonce) - } - // Get the receiver receiver := block.state.GetAccount(tx.Recipient) sender.Nonce += 1 |