<!-- XE-13309 · [net/gossip.go] H8: gossipHandler() tidak handle stream close — resource leak · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13309>. The page is the record; this is the same page for reading.*

XE-13309 · Bounty

# \[net/gossip.go\] H8: gossipHandler() tidak handle stream close — resource leak

Closed · invalid
—
[xe#454](https://github.com/xeprotocol/xe/issues/454)
filed 2026-11-12 02:54 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

- [559441](https://bounty.xe.network/log/559441) 2026-11-20 00:50 UTC reply.mirrored
- [558502](https://bounty.xe.network/log/558502) 2026-11-20 00:49 UTC reply.sent
- [554105](https://bounty.xe.network/log/554105) 2026-11-20 00:36 UTC github.state\_pushed
- [554104](https://bounty.xe.network/log/554104) 2026-11-20 00:36 UTC github.labels
- [553374](https://bounty.xe.network/log/553374) 2026-11-20 00:33 UTC proposal.adopted
- [553204](https://bounty.xe.network/log/553204) 2026-11-20 00:33 UTC proposal.adopted
- [553203](https://bounty.xe.network/log/553203) 2026-11-20 00:33 UTC ticket.status new → closed
- [552877](https://bounty.xe.network/log/552877) 2026-11-20 00:33 UTC proposal.adopted
- [552876](https://bounty.xe.network/log/552876) 2026-11-20 00:33 UTC ticket.facts area
- [552875](https://bounty.xe.network/log/552875) 2026-11-20 00:33 UTC proposal.adopted
- [552874](https://bounty.xe.network/log/552874) 2026-11-20 00:33 UTC ticket.facts
- [550374](https://bounty.xe.network/log/550374) 2026-11-20 00:28 UTC note.added

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

### Report

## Ringkasan

Kalau stream di-close sebelum message selesai di-proses, handler tidak di-cleanup. Resource leak.

## Lokasi

- File: `net/gossip.go`
- Lines: 219-245

## Kode

```
func (g *Gossip) gossipHandler(stream network.Stream) {
    ...
    var msg GossipMessage
    if err := gob.NewDecoder(stream).Decode(&msg); err != nil {
        logging.Debugf("gossip: failed to decode message: %v", err)
        return
    }
    g.handleMessage(msg)
}
```

## Impact

Resource leak kalau stream di-close sebelum message selesai di-proses.

## Suggested Fix

```
func (g *Gossip) gossipHandler(stream network.Stream) {
    ...
    defer stream.Close()

    var msg GossipMessage
    if err := gob.NewDecoder(stream).Decode(&msg); err != nil {
        logging.Debugf("gossip: failed to decode message: %v", err)
        return
    }
    g.handleMessage(msg)
}
```

### 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-13309 and says what; it is read like any other.
