From b765e2d19c9154dcaa38e6043f96f709a7e75796 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Mon, 26 Jan 2015 10:57:23 -0800 Subject: [PATCH] check tx sender is valid --- core/transaction_pool.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/transaction_pool.go b/core/transaction_pool.go index d3aec90502..40fe582208 100644 --- a/core/transaction_pool.go +++ b/core/transaction_pool.go @@ -65,6 +65,11 @@ func (pool *TxPool) ValidateTransaction(tx *types.Transaction) error { return fmt.Errorf("tx.v != (28 || 27) => %v", v) } + senderAddr := tx.From() + if senderAddr == nil || len(senderAddr) != 20 { + return fmt.Errorf("invalid sender") + } + /* XXX this kind of validation needs to happen elsewhere in the gui when sending txs. Other clients should do their own validation. Value transfer could throw error but doesn't necessarily invalidate the tx. Gas can still be payed for and miner