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

XE-13272 · Bounty

# \[net/msg.go\] L1: Handle() tidak cek duplicate registration — silent overwrite

Closed · invalid
—
[xe#417](https://github.com/xeprotocol/xe/issues/417)
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

- [557213](https://bounty.xe.network/log/557213) 2026-11-20 00:49 UTC reply.mirrored
- [557035](https://bounty.xe.network/log/557035) 2026-11-20 00:48 UTC reply.sent
- [554310](https://bounty.xe.network/log/554310) 2026-11-20 00:37 UTC github.state\_pushed
- [554295](https://bounty.xe.network/log/554295) 2026-11-20 00:37 UTC github.labels
- [553309](https://bounty.xe.network/log/553309) 2026-11-20 00:33 UTC proposal.adopted
- [553074](https://bounty.xe.network/log/553074) 2026-11-20 00:33 UTC proposal.adopted
- [553073](https://bounty.xe.network/log/553073) 2026-11-20 00:33 UTC ticket.status new → closed
- [552345](https://bounty.xe.network/log/552345) 2026-11-20 00:33 UTC proposal.adopted
- [552344](https://bounty.xe.network/log/552344) 2026-11-20 00:33 UTC ticket.facts area
- [552343](https://bounty.xe.network/log/552343) 2026-11-20 00:33 UTC proposal.adopted
- [552342](https://bounty.xe.network/log/552342) 2026-11-20 00:33 UTC ticket.facts
- [551469](https://bounty.xe.network/log/551469) 2026-11-20 00:32 UTC note.added

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

### Report

## Ringkasan

Handler yang di-register dengan msgType yang sama akan ditimpa tanpa warning.

## Lokasi

- File: `net/msg.go`
- Lines: 147-151

## Kode

```
func (m *Messenger) Handle(msgType string, handler func(peer.ID, json.RawMessage) (json.RawMessage, error)) {
    m.mu.Lock()
    m.handlers[msgType] = handler
    m.mu.Unlock()
}
```

## Impact

Kalau ada dua panggilan `Handle` dengan msgType sama, handler pertama hilang tanpa notice. Bisa menyebabkan behavior tidak expected.

## Suggested Fix

```
func (m *Messenger) Handle(msgType string, handler func(peer.ID, json.RawMessage) (json.RawMessage, error)) {
    if handler == nil {
        return
    }
    m.mu.Lock()
    if _, exists := m.handlers[msgType]; exists {
        logging.Warnf("msg: duplicate handler registration for %q", msgType)
    }
    m.handlers[msgType] = handler
    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-13272 and says what; it is read like any other.
