<!-- XE-13313 · [net/gossip.go] H12: broadcast() tidak pilih peer yang capable — broadcast ke peer yang tidak support gossip · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13313>. The page is the record; this is the same page for reading.*

XE-13313 · Bounty

# \[net/gossip.go\] H12: broadcast() tidak pilih peer yang capable — broadcast ke peer yang tidak support gossip

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

- [559435](https://bounty.xe.network/log/559435) 2026-11-20 00:50 UTC reply.mirrored
- [558493](https://bounty.xe.network/log/558493) 2026-11-20 00:49 UTC reply.sent
- [554210](https://bounty.xe.network/log/554210) 2026-11-20 00:36 UTC github.state\_pushed
- [554205](https://bounty.xe.network/log/554205) 2026-11-20 00:36 UTC github.labels
- [553370](https://bounty.xe.network/log/553370) 2026-11-20 00:33 UTC proposal.adopted
- [553192](https://bounty.xe.network/log/553192) 2026-11-20 00:33 UTC proposal.adopted
- [553191](https://bounty.xe.network/log/553191) 2026-11-20 00:33 UTC ticket.status new → closed
- [552860](https://bounty.xe.network/log/552860) 2026-11-20 00:33 UTC proposal.adopted
- [552859](https://bounty.xe.network/log/552859) 2026-11-20 00:33 UTC ticket.facts area
- [552858](https://bounty.xe.network/log/552858) 2026-11-20 00:33 UTC proposal.adopted
- [552857](https://bounty.xe.network/log/552857) 2026-11-20 00:33 UTC ticket.facts
- [550397](https://bounty.xe.network/log/550397) 2026-11-20 00:29 UTC note.added

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

### Report

## Ringkasan

Kalau peer tidak support gossip protocol, broadcast tetap dikirim. Waste resource.

## 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

Waste resource kalau broadcast ke peer yang tidak support gossip.

## Suggested Fix

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

func (g *Gossip) peerMaySupportGossip(pid peer.ID) bool {
    ps := g.host.Peerstore()
    if ps == nil {
        return false
    }
    protos, err := ps.GetProtocols(pid)
    if err != nil {
        return false
    }
    for _, p := range protos {
        if strings.HasPrefix(p, GossipProtocolID) {
            return true
        }
    }
    return false
}
```

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