wip: DropAllTxs for legacypool

This commit is contained in:
Jared Wasinger 2024-10-01 17:32:24 +07:00 committed by Felix Lange
parent df182a742c
commit 692834ec7a

View file

@ -239,6 +239,19 @@ type txpoolResetRequest struct {
oldHead, newHead *types.Header
}
func (p *LegacyPool) DropAllTxs() {
p.mu.Lock()
defer p.mu.Unlock()
p.all = newLookup()
p.priced = newPricedList(p.all)
p.pending = make(map[common.Address]*list)
p.queue = make(map[common.Address]*list)
if !p.config.NoLocals && p.config.Journal != "" {
// TODO: do we need to truncate the existing journal here?
p.journal = newTxJournal(p.config.Journal)
}
}
// New creates a new transaction pool to gather, sort and filter inbound
// transactions from the network.
func New(config Config, chain BlockChain) *LegacyPool {