Skip to content

Commit 00de538

Browse files
committed
fix: goroutine leak
1 parent 3b82419 commit 00de538

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

p2p/conns.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,14 @@ func (c *Conns) BroadcastTxHashes(hashes []common.Hash) int {
191191

192192
count := 0
193193
for _, cn := range peers {
194+
// Non-blocking send, drop if queue full (matches Bor behavior)
194195
select {
195196
case cn.txAnnounce <- hashes:
196197
count++
197198
case <-cn.closeCh:
198199
// Peer closing, skip
200+
default:
201+
// Channel full, skip to avoid goroutine leak
199202
}
200203
}
201204

0 commit comments

Comments
 (0)