core/txpool: use the cached address in ValidateTransactionWithState (#30208)
The address recover is executed and cached in ValidateTransaction already. It's expected that the cached one is returned in ValidateTransaction. However, currently, we use the wrong function signer.Sender instead of types.Sender which will do all the address recover again.
This commit is contained in:
parent
7026bae17c
commit
6693fe1be2
|
@ -201,7 +201,7 @@ type ValidationOptionsWithState struct {
|
|||
// rules without duplicating code and running the risk of missed updates.
|
||||
func ValidateTransactionWithState(tx *types.Transaction, signer types.Signer, opts *ValidationOptionsWithState) error {
|
||||
// Ensure the transaction adheres to nonce ordering
|
||||
from, err := signer.Sender(tx) // already validated (and cached), but cleaner to check
|
||||
from, err := types.Sender(signer, tx) // already validated (and cached), but cleaner to check
|
||||
if err != nil {
|
||||
log.Error("Transaction sender recovery failed", "err", err)
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue