{"id":"XE-13316","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"461","source_url":"https://github.com/xeprotocol/xe/issues/461","reporter_id":2483,"title":"[net/gossip.go] H15: broadcast() tidak handle peer yang tidak reachable — resource 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.268832+00:00","updated_at":"2026-11-20T00:51:18.525346+00:00","source_created_at":"2026-11-12T02:55:57+00:00","told_at":"2026-11-20T00:50:16+00:00","status_changed_at":"2026-11-20T00:33:26.317606+00:00","url":"https://bounty.xe.network/XE-13316","body":"## Ringkasan\nKalau peer tidak reachable, broadcast tetap dikirim. Kalau error terjadi berulang, resource bisa menumpuk.\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 g.peers {\n        if pid == g.host.ID() {\n            continue\n        }\n        go g.sendToPeer(pid, key, msg)\n    }\n}\n```\n\n## Impact\nResource leak kalau peer tidak reachable. Bisa menyebabkan resource exhaustion.\n\n## Suggested Fix\n```go\nfunc (g *Gossip) broadcast(key string, msg []byte, mode GossipMode) {\n    ...\n    for pid := range g.peers {\n        if pid == g.host.ID() {\n            continue\n        }\n        go g.sendToPeerWithRetry(pid, key, msg)\n    }\n}\n\nfunc (g *Gossip) sendToPeerWithRetry(pid peer.ID, key string, msg []byte) {\n    var lastErr error\n    for i := 0; i < 3; i++ {\n        if err := g.sendToPeer(pid, key, msg); err != nil {\n            lastErr = err\n            logging.Warnf(\"gossip: failed to send message to %s (attempt %d): %v\", pid, i+1, err)\n            time.Sleep(time.Second * time.Duration(i+1))\n            continue\n        }\n        return\n    }\n    logging.Warnf(\"gossip: failed to send message to %s after 3 attempts: %v\", pid, lastErr)\n}\n```","patch_refs":[],"thread":[{"id":13389,"source":"github","source_ref":"7026808760","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-13316 and says what; it is read like any other.","created_at":"2026-11-20T00:50:16+00:00"}]}