Skip to content

Commit

Permalink
core/txpool: terminate subpool reset goroutine if pool was closed (#3…
Browse files Browse the repository at this point in the history
…1030)

if the pool terminates before `resetDone` can be read, then the
go-routine will hang.
  • Loading branch information
jwasinger authored Jan 21, 2025
1 parent 530adfc commit e25cedf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,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
Expand Down

0 comments on commit e25cedf

Please sign in to comment.