diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-19 07:33:05 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-19 07:33:05 +0800 |
commit | 207b6c50fb6dcc698bac832e98b2d633f79532e4 (patch) | |
tree | 8b5e31c3b8c89565b1a6f9f4fce3da991d0f71e3 /core/transaction_pool.go | |
parent | 6e24b1587de95b45fe0d7623528bb2f5a48e9823 (diff) | |
parent | 7c24cd790d39b67ee16ad7f1b1a805fcb131dc8a (diff) | |
download | dexon-207b6c50fb6dcc698bac832e98b2d633f79532e4.tar.gz dexon-207b6c50fb6dcc698bac832e98b2d633f79532e4.tar.zst dexon-207b6c50fb6dcc698bac832e98b2d633f79532e4.zip |
Merge branch 'badsig' of https://github.com/ebuchman/go-ethereum into ebuchman-badsig
Conflicts:
core/transaction_pool.go
Diffstat (limited to 'core/transaction_pool.go')
-rw-r--r-- | core/transaction_pool.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/transaction_pool.go b/core/transaction_pool.go index 17fcdb86a..1149d4cfb 100644 --- a/core/transaction_pool.go +++ b/core/transaction_pool.go @@ -116,7 +116,11 @@ func (pool *TxPool) ValidateTransaction(tx *types.Transaction) error { } // Get the sender - sender := pool.chainManager.State().GetAccount(tx.Sender()) + senderAddr := tx.From() + if senderAddr == nil { + return fmt.Errorf("invalid sender") + } + sender := pool.chainManager.State().GetAccount(senderAddr) totAmount := new(big.Int).Set(tx.Value()) // Make sure there's enough in the sender's account. Having insufficient @@ -193,7 +197,7 @@ func (pool *TxPool) RemoveInvalid(state *state.StateDB) { for e := pool.pool.Front(); e != nil; e = e.Next() { tx := e.Value.(*types.Transaction) - sender := state.GetAccount(tx.Sender()) + sender := state.GetAccount(tx.From()) err := pool.ValidateTransaction(tx) if err != nil || sender.Nonce >= tx.Nonce() { pool.pool.Remove(e) |