<!-- XE-13277 · [net/msg.go] L6: Start() tidak cek duplikat stream handler — silent overwrite · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13277>. The page is the record; this is the same page for reading.*

XE-13277 · Bounty

# \[net/msg.go\] L6: Start() tidak cek duplikat stream handler — silent overwrite

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

### Patches

None linked.

### History

- [557340](https://bounty.xe.network/log/557340) 2026-11-20 00:49 UTC reply.mirrored
- [557067](https://bounty.xe.network/log/557067) 2026-11-20 00:48 UTC reply.sent
- [554787](https://bounty.xe.network/log/554787) 2026-11-20 00:37 UTC github.state\_pushed
- [554778](https://bounty.xe.network/log/554778) 2026-11-20 00:37 UTC github.labels
- [553336](https://bounty.xe.network/log/553336) 2026-11-20 00:33 UTC proposal.adopted
- [553132](https://bounty.xe.network/log/553132) 2026-11-20 00:33 UTC proposal.adopted
- [553131](https://bounty.xe.network/log/553131) 2026-11-20 00:33 UTC ticket.status new → closed
- [552600](https://bounty.xe.network/log/552600) 2026-11-20 00:33 UTC proposal.adopted
- [552599](https://bounty.xe.network/log/552599) 2026-11-20 00:33 UTC ticket.facts area
- [552594](https://bounty.xe.network/log/552594) 2026-11-20 00:33 UTC proposal.adopted
- [552593](https://bounty.xe.network/log/552593) 2026-11-20 00:33 UTC ticket.facts
- [551057](https://bounty.xe.network/log/551057) 2026-11-20 00:31 UTC note.added

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

### Report

## Ringkasan

Kalau `Start` dipanggil dua kali dengan protocol yang sama, stream handler yang lama ditimpa tanpa warning.

## Lokasi

- File: `net/msg.go`
- Lines: 169-185

## Kode

```
func (m *Messenger) Start(h host.Host, ng *NetworkGater, opts ...Option) {
    ...
    h.SetStreamHandler(m.protocol, func(s network.Stream) {
        ...
    })
    ...
}
```

## Impact

Handler lama ditimpa. Kalau ada goroutine yang masih memproses handler lama, bisa terjadi race condition.

## Suggested Fix

```
func (m *Messenger) Start(h host.Host, ng *NetworkGater, opts ...Option) {
    ...
    if m.started {
        logging.Warnf("msg: Start() called multiple times, skipping duplicate registration")
        return
    }
    m.started = true
    h.SetStreamHandler(m.protocol, func(s network.Stream) {
        ...
    })
    ...
}
```

### Thread

**XE desk**team2026-11-20 00:49 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-13277 and says what; it is read like any other.
