aboutsummaryrefslogtreecommitdiffstats
path: root/chain/transaction_pool.go
diff options
context:
space:
mode:
authorEthan Buchman <ethan@coinculture.info>2014-11-29 08:39:20 +0800
committerEthan Buchman <ethan@coinculture.info>2014-11-29 08:42:05 +0800
commit7c24cd790d39b67ee16ad7f1b1a805fcb131dc8a (patch)
tree9b9e6e49fcd855884b6718350252fe7461ba60d2 /chain/transaction_pool.go
parent8cf9ed0ea588e97f2baf0f834248727e8fbca18f (diff)
downloaddexon-7c24cd790d39b67ee16ad7f1b1a805fcb131dc8a.tar.gz
dexon-7c24cd790d39b67ee16ad7f1b1a805fcb131dc8a.tar.zst
dexon-7c24cd790d39b67ee16ad7f1b1a805fcb131dc8a.zip
fix panic on bad sender
Diffstat (limited to 'chain/transaction_pool.go')
-rw-r--r--chain/transaction_pool.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/chain/transaction_pool.go b/chain/transaction_pool.go
index 119712ba8..ae96b0251 100644
--- a/chain/transaction_pool.go
+++ b/chain/transaction_pool.go
@@ -116,7 +116,11 @@ func (pool *TxPool) ValidateTransaction(tx *types.Transaction) error {
// Get the sender
//sender := pool.Ethereum.BlockManager().procState.GetAccount(tx.Sender())
- sender := pool.Ethereum.BlockManager().CurrentState().GetAccount(tx.Sender())
+ senderAddr := tx.Sender()
+ if senderAddr == nil {
+ return fmt.Errorf("Invalid sender")
+ }
+ sender := pool.Ethereum.BlockManager().CurrentState().GetAccount(senderAddr)
totAmount := new(big.Int).Set(tx.Value)
// Make sure there's enough in the sender's account. Having insufficient