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

XE-13278 · Bounty

# \[net/msg.go\] L7: Stop() tidak cek duplikat network notifier — silent overwrite

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

- [557326](https://bounty.xe.network/log/557326) 2026-11-20 00:49 UTC reply.mirrored
- [557066](https://bounty.xe.network/log/557066) 2026-11-20 00:48 UTC reply.sent
- [554285](https://bounty.xe.network/log/554285) 2026-11-20 00:37 UTC github.state\_pushed
- [554278](https://bounty.xe.network/log/554278) 2026-11-20 00:37 UTC github.labels
- [553335](https://bounty.xe.network/log/553335) 2026-11-20 00:33 UTC proposal.adopted
- [553130](https://bounty.xe.network/log/553130) 2026-11-20 00:33 UTC proposal.adopted
- [553129](https://bounty.xe.network/log/553129) 2026-11-20 00:33 UTC ticket.status new → closed
- [552589](https://bounty.xe.network/log/552589) 2026-11-20 00:33 UTC proposal.adopted
- [552588](https://bounty.xe.network/log/552588) 2026-11-20 00:33 UTC ticket.facts area
- [552584](https://bounty.xe.network/log/552584) 2026-11-20 00:33 UTC proposal.adopted
- [552583](https://bounty.xe.network/log/552583) 2026-11-20 00:33 UTC ticket.facts
- [551070](https://bounty.xe.network/log/551070) 2026-11-20 00:31 UTC note.added

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

### Report

## Ringkasan

Kalau `Stop` dipanggil dua kali, network notifier yang lama ditimpa tanpa warning. Tidak ada check apakah sudah di-register.

## Lokasi

- File: `net/msg.go`
- Lines: 187-193

## Kode

```
func (m *Messenger) Stop() {
    m.mu.Lock()
    m.notifiers = append(m.notifiers, network.NotifyBundle{
        DisconnectedF: func(n network.Network, conn network.Conn) {
            m.mu.Lock()
            m.peers.Delete(conn.RemotePeer())
            m.mu.Unlock()
        },
    })
    m.mu.Unlock()
}
```

## Impact

Notifier ditambahkan berulang kali kalau `Stop` dipanggil berkali-kali. Bisa menyebabkan multiple callback dipanggil.

## Suggested Fix

```
func (m *Messenger) Stop() {
    m.mu.Lock()
    defer m.mu.Unlock()
    if m.stopped {
        return
    }
    m.stopped = true
    m.notifiers = append(m.notifiers, network.NotifyBundle{
        DisconnectedF: func(n network.Network, conn network.Conn) {
            m.mu.Lock()
            m.peers.Delete(conn.RemotePeer())
            m.mu.Unlock()
        },
    })
}
```

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