reset yielded state in txpool (#777)

This commit is contained in:
hexoscott 2022-12-12 10:14:56 +00:00 committed by GitHub
parent d70b55bc1a
commit aa99053b78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -675,6 +675,15 @@ func (p *TxPool) best(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, availableG
return success, err
}
func (p *TxPool) ResetYieldedStatus() {
p.lock.Lock()
defer p.lock.Unlock()
best := p.pending.best
for i := 0; i < len(best.ms); i++ {
best.ms[i].alreadyYielded = false
}
}
func (p *TxPool) YieldBest(n uint16, txs *types.TxsRlp, tx kv.Tx, onTopOf, availableGas uint64) (bool, error) {
return p.best(n, txs, tx, onTopOf, availableGas, true)
}