mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
* fix(core/txpool): coordinate reset lifecycle and shutdown signaling #28837 Improve txpool loop synchronization around background resets. This change: - adds an explicit termination channel to signal pool shutdown - tracks forced-reset intent and a waiter channel inside the reset loop - ensures reset waiters are notified on completion or on pool termination - allows an explicit sync request path to trigger an additional reset round when needed Scope is limited to internal txpool concurrency control in core/txpool/txpool.go, with no protocol or RPC behavior change. * fix(core/txpool): avoid blocking reset completion on close #31030
This commit is contained in:
parent
5625cf6f6e
commit
6f02401575
1 changed files with 4 additions and 1 deletions
|
|
@ -166,7 +166,10 @@ func (p *TxPool) loop(head *types.Header, chain BlockChain) {
|
|||
for _, subpool := range p.subpools {
|
||||
subpool.Reset(oldHead, newHead)
|
||||
}
|
||||
resetDone <- newHead
|
||||
select {
|
||||
case resetDone <- newHead:
|
||||
case <-p.term:
|
||||
}
|
||||
}(oldHead, newHead)
|
||||
|
||||
// If the reset operation was explicitly requested, consider it
|
||||
|
|
|
|||
Loading…
Reference in a new issue