core/txpool/legacypool: use types.Sender instead of signer.Sender

`pool.signer.Sender(tx)` bypasses the sender cache used by types.Sender, which can force an extra signature recovery for every promotable tx (promotion runs frequently). Use `types.Sender(pool.signer, tx)` here to keep sender derivation cached and consistent.
This commit is contained in:
Daniel Liu 2026-03-20 17:46:53 +08:00
parent 59ce2cb6a1
commit 610de75434

View file

@ -1408,7 +1408,7 @@ func (pool *LegacyPool) promoteExecutables(accounts []common.Address) []*types.T
// promote all promotable transactions
promoted := make([]*types.Transaction, 0, len(promotable))
for _, tx := range promotable {
from, _ := pool.signer.Sender(tx)
from, _ := types.Sender(pool.signer, tx) // already validated
if pool.promoteTx(from, tx.Hash(), tx) {
promoted = append(promoted, tx)
}