Skip to content

Commit

Permalink
Merge branch '1mgas-txpool-v0.3.0-demote' into 1mgas.vbase.v.improve
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhang2023 committed Apr 9, 2024
2 parents ab416b0 + f162e61 commit efa3177
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -1503,14 +1503,18 @@ func (pool *LegacyPool) reset(oldHead, newHead *types.Header) (demoteAddrs []com
var collectAddr = func(txs types.Transactions) {
addrs := make(map[common.Address]struct{})
for _, tx := range txs {
if !pool.Filter(tx) {
continue
}
// it is heavy to get sender from tx, so we try to get it from the pool
if oldtx := pool.all.Get(tx.Hash()); oldtx != nil {
tx = oldtx
}
addr, err := types.Sender(pool.signer, tx)
//it might come from other pool, by other signer
if err != nil {
continue
}
if !pool.Filter(tx) {
continue
}
addrs[addr] = struct{}{}
}
demoteAddrs = make([]common.Address, 0, len(addrs))
Expand Down

0 comments on commit efa3177

Please sign in to comment.