core/txpool/legacypool: change receiver name

This commit is contained in:
Felix Lange 2024-11-13 11:11:13 +01:00
parent 8d241f0475
commit fbc98ae50e

View file

@ -1964,9 +1964,9 @@ func numSlots(tx *types.Transaction) int {
// Clear implements txpool.SubPool, removing all tracked txs from the pool // Clear implements txpool.SubPool, removing all tracked txs from the pool
// and rotating the journal. // and rotating the journal.
func (p *LegacyPool) Clear() { func (pool *LegacyPool) Clear() {
p.mu.Lock() pool.mu.Lock()
defer p.mu.Unlock() defer pool.mu.Unlock()
// unreserve each tracked account. Ideally, we could just clear the // unreserve each tracked account. Ideally, we could just clear the
// reservation map in the parent txpool context. However, if we clear in // reservation map in the parent txpool context. However, if we clear in
@ -1982,22 +1982,22 @@ func (p *LegacyPool) Clear() {
// The transaction addition may attempt to reserve the sender addr which // The transaction addition may attempt to reserve the sender addr which
// can't happen until Clear releases the reservation lock. Clear cannot // can't happen until Clear releases the reservation lock. Clear cannot
// acquire the subpool lock until the transaction addition is completed. // acquire the subpool lock until the transaction addition is completed.
for _, tx := range p.all.remotes { for _, tx := range pool.all.remotes {
senderAddr, _ := types.Sender(p.signer, tx) senderAddr, _ := types.Sender(pool.signer, tx)
p.reserve(senderAddr, false) pool.reserve(senderAddr, false)
} }
for localSender, _ := range p.locals.accounts { for localSender, _ := range pool.locals.accounts {
p.reserve(localSender, false) pool.reserve(localSender, false)
} }
p.all = newLookup() pool.all = newLookup()
p.priced = newPricedList(p.all) pool.priced = newPricedList(pool.all)
p.pending = make(map[common.Address]*list) pool.pending = make(map[common.Address]*list)
p.queue = make(map[common.Address]*list) pool.queue = make(map[common.Address]*list)
if !p.config.NoLocals && p.config.Journal != "" { if !pool.config.NoLocals && pool.config.Journal != "" {
p.journal = newTxJournal(p.config.Journal) pool.journal = newTxJournal(pool.config.Journal)
if err := p.journal.rotate(p.local()); err != nil { if err := pool.journal.rotate(pool.local()); err != nil {
log.Warn("Failed to rotate transaction journal", "err", err) log.Warn("Failed to rotate transaction journal", "err", err)
} }
} }