<!-- XE-13293 · [net/sync.go] M7: peerMaySupportSync() terlalu permisif — peer yang tidak support sync tetap diseret · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13293>. The page is the record; this is the same page for reading.*

XE-13293 · Bounty

# \[net/sync.go\] M7: peerMaySupportSync() terlalu permisif — peer yang tidak support sync tetap diseret

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

- [557671](https://bounty.xe.network/log/557671) 2026-11-20 00:49 UTC reply.mirrored
- [557087](https://bounty.xe.network/log/557087) 2026-11-20 00:48 UTC reply.sent
- [554159](https://bounty.xe.network/log/554159) 2026-11-20 00:36 UTC github.state\_pushed
- [554156](https://bounty.xe.network/log/554156) 2026-11-20 00:36 UTC github.labels
- [553359](https://bounty.xe.network/log/553359) 2026-11-20 00:33 UTC proposal.adopted
- [553169](https://bounty.xe.network/log/553169) 2026-11-20 00:33 UTC proposal.adopted
- [553168](https://bounty.xe.network/log/553168) 2026-11-20 00:33 UTC ticket.status new → closed
- [552795](https://bounty.xe.network/log/552795) 2026-11-20 00:33 UTC proposal.adopted
- [552794](https://bounty.xe.network/log/552794) 2026-11-20 00:33 UTC ticket.facts area
- [552790](https://bounty.xe.network/log/552790) 2026-11-20 00:33 UTC proposal.adopted
- [552789](https://bounty.xe.network/log/552789) 2026-11-20 00:33 UTC ticket.facts
- [550813](https://bounty.xe.network/log/550813) 2026-11-20 00:30 UTC note.added

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

### Report

## Ringkasan

Kalau peerstore gagal mengambil protokol atau return list kosong, fungsi return `true`. Peer yang tidak support sync tetap diseret ke sync attempt.

## Lokasi

- File: `net/sync.go`
- Lines: 759-775

## Kode

```
func peerMaySupportSync(h host.Host, pid peer.ID) bool {
    ps := h.Peerstore()
    if ps == nil {
        return true
    }
    protos, err := ps.GetProtocols(pid)
    if err != nil || len(protos) == 0 {
        return true  // terlalu permisif
    }
    for _, p := range protos {
        if strings.HasPrefix(p, SyncProtocolPrefix) {
            return true
        }
    }
    return false
}
```

## Impact

Peer yang tidak support sync tetap diseret ke sync attempt. Waste resource, potensi error.

## Suggested Fix

```
func peerMaySupportSync(h host.Host, pid peer.ID) bool {
    ps := h.Peerstore()
    if ps == nil {
        return false  // lebih konservatif
    }
    protos, err := ps.GetProtocols(pid)
    if err != nil {
        logging.Debugf("sync: failed to get protocols for %s: %v", pid, err)
        return false
    }
    if len(protos) == 0 {
        return false
    }
    for _, p := range protos {
        if strings.HasPrefix(p, SyncProtocolPrefix) {
            return true
        }
    }
    return false
}
```

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