good morning!!!!

Skip to content
Snippets Groups Projects
Commit 7c24cd79 authored by Ethan Buchman's avatar Ethan Buchman
Browse files

fix panic on bad sender

parent 8cf9ed0e
Branches
Tags
No related merge requests found
...@@ -116,7 +116,11 @@ func (pool *TxPool) ValidateTransaction(tx *types.Transaction) error { ...@@ -116,7 +116,11 @@ func (pool *TxPool) ValidateTransaction(tx *types.Transaction) error {
// Get the sender // Get the sender
//sender := pool.Ethereum.BlockManager().procState.GetAccount(tx.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) totAmount := new(big.Int).Set(tx.Value)
// Make sure there's enough in the sender's account. Having insufficient // Make sure there's enough in the sender's account. Having insufficient
......
...@@ -116,7 +116,7 @@ func (tx *Transaction) Sender() []byte { ...@@ -116,7 +116,7 @@ func (tx *Transaction) Sender() []byte {
// Validate the returned key. // Validate the returned key.
// Return nil if public key isn't in full format // Return nil if public key isn't in full format
if len(pubkey) != 0 && pubkey[0] != 4 { if len(pubkey) == 0 || pubkey[0] != 4 {
return nil return nil
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment