mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
check tx sender is valid
This commit is contained in:
parent
48083608b5
commit
b765e2d19c
1 changed files with 5 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue