{"id":"XE-13308","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"453","source_url":"https://github.com/xeprotocol/xe/issues/453","reporter_id":2483,"title":"[net/gossip.go] H7: broadcast() tidak handle context cancellation — goroutine leak","area":"p2p-sync","claimed_tier":null,"assessed_tier":null,"verdict":"invalid","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"invalid","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:09.108819+00:00","updated_at":"2026-11-20T00:51:20.872119+00:00","source_created_at":"2026-11-12T02:54:32+00:00","told_at":"2026-11-20T00:50:24+00:00","status_changed_at":"2026-11-20T00:33:26.567078+00:00","url":"https://bounty.xe.network/XE-13308","body":"## Ringkasan\nKalau context cancelled, broadcast goroutine tetap berjalan sampai selesai. Tidak ada cleanup mechanism.\n\n## Lokasi\n- File: `net/gossip.go`\n- Lines: 171-187\n\n## Kode\n```go\nfunc (g *Gossip) broadcast(key string, msg []byte, mode GossipMode) {\n    ...\n    for _, pid := range peers {\n        go g.sendToPeer(pid, key, msg)\n    }\n}\n```\n\n## Impact\nGoroutine leak kalau context cancelled. Resource exhaustion.\n\n## Suggested Fix\n```go\nfunc (g *Gossip) broadcast(ctx context.Context, key string, msg []byte, mode GossipMode) {\n    ...\n    for _, pid := range peers {\n        go func(pid peer.ID) {\n            select {\n            case <-ctx.Done():\n                return\n            default:\n                g.sendToPeer(pid, key, msg)\n            }\n        }(pid)\n    }\n}\n```","patch_refs":[],"thread":[{"id":13397,"source":"github","source_ref":"7026811322","author":"XE desk","team":true,"body":"Thanks for the report. We read it against the code and could not confirm a bug in what it describes.\n\nThis report is closed as invalid. If we have missed something, file a new report that links\nhttps://bounty.xe.network/XE-13308 and says what; it is read like any other.","created_at":"2026-11-20T00:50:24+00:00"}]}