<!-- XE-13316 · [net/gossip.go] H15: broadcast() tidak handle peer yang tidak reachable — resource leak · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13316>. The page is the record; this is the same page for reading.*

XE-13316 · Bounty

# \[net/gossip.go\] H15: broadcast() tidak handle peer yang tidak reachable — resource leak

Closed · invalid
—
[xe#461](https://github.com/xeprotocol/xe/issues/461)
filed 2026-11-12 02:55 UTC
by wahyu20260100233-ops

Verdict
:   Invalid

Tier
:   —

Claimed
:   —

Area
:   P2P / sync

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 00:51 UTC

Told
:   2026-11-20 00:50 UTC

### Patches

None linked.

### History

- [559432](https://bounty.xe.network/log/559432) 2026-11-20 00:50 UTC reply.mirrored
- [558488](https://bounty.xe.network/log/558488) 2026-11-20 00:49 UTC reply.sent
- [554088](https://bounty.xe.network/log/554088) 2026-11-20 00:36 UTC github.state\_pushed
- [554085](https://bounty.xe.network/log/554085) 2026-11-20 00:36 UTC github.labels
- [553367](https://bounty.xe.network/log/553367) 2026-11-20 00:33 UTC proposal.adopted
- [553186](https://bounty.xe.network/log/553186) 2026-11-20 00:33 UTC proposal.adopted
- [553185](https://bounty.xe.network/log/553185) 2026-11-20 00:33 UTC ticket.status new → closed
- [552843](https://bounty.xe.network/log/552843) 2026-11-20 00:33 UTC proposal.adopted
- [552842](https://bounty.xe.network/log/552842) 2026-11-20 00:33 UTC ticket.facts area
- [552841](https://bounty.xe.network/log/552841) 2026-11-20 00:33 UTC proposal.adopted
- [552840](https://bounty.xe.network/log/552840) 2026-11-20 00:33 UTC ticket.facts
- [550418](https://bounty.xe.network/log/550418) 2026-11-20 00:29 UTC note.added

[Full history](https://bounty.xe.network/log?ref=XE-13316) · [JSON](https://bounty.xe.network/v1/tickets/XE-13316) · [markdown](https://bounty.xe.network/XE-13316.md)

### Report

## Ringkasan

Kalau peer tidak reachable, broadcast tetap dikirim. Kalau error terjadi berulang, resource bisa menumpuk.

## Lokasi

- File: `net/gossip.go`
- Lines: 171-187

## Kode

```
func (g *Gossip) broadcast(key string, msg []byte, mode GossipMode) {
    ...
    for pid := range g.peers {
        if pid == g.host.ID() {
            continue
        }
        go g.sendToPeer(pid, key, msg)
    }
}
```

## Impact

Resource leak kalau peer tidak reachable. Bisa menyebabkan resource exhaustion.

## Suggested Fix

```
func (g *Gossip) broadcast(key string, msg []byte, mode GossipMode) {
    ...
    for pid := range g.peers {
        if pid == g.host.ID() {
            continue
        }
        go g.sendToPeerWithRetry(pid, key, msg)
    }
}

func (g *Gossip) sendToPeerWithRetry(pid peer.ID, key string, msg []byte) {
    var lastErr error
    for i := 0; i < 3; i++ {
        if err := g.sendToPeer(pid, key, msg); err != nil {
            lastErr = err
            logging.Warnf("gossip: failed to send message to %s (attempt %d): %v", pid, i+1, err)
            time.Sleep(time.Second * time.Duration(i+1))
            continue
        }
        return
    }
    logging.Warnf("gossip: failed to send message to %s after 3 attempts: %v", pid, lastErr)
}
```

### Thread

**XE desk**team2026-11-20 00:50 UTCgithub

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links
https://bounty.xe.network/XE-13316 and says what; it is read like any other.
