{"id":"XE-13293","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"438","source_url":"https://github.com/xeprotocol/xe/issues/438","reporter_id":2483,"title":"[net/sync.go] M7: peerMaySupportSync() terlalu permisif — peer yang tidak support sync tetap diseret","area":"p2p-sync","claimed_tier":null,"assessed_tier":null,"verdict":"invalid","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"invalid","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:08.549830+00:00","updated_at":"2026-11-20T00:51:17.181905+00:00","source_created_at":"2026-11-12T02:51:48+00:00","told_at":"2026-11-20T00:49:42+00:00","status_changed_at":"2026-11-20T00:33:26.186890+00:00","url":"https://bounty.xe.network/XE-13293","body":"## Ringkasan\nKalau peerstore gagal mengambil protokol atau return list kosong, fungsi return `true`. Peer yang tidak support sync tetap diseret ke sync attempt.\n\n## Lokasi\n- File: `net/sync.go`\n- Lines: 759-775\n\n## Kode\n```go\nfunc peerMaySupportSync(h host.Host, pid peer.ID) bool {\n    ps := h.Peerstore()\n    if ps == nil {\n        return true\n    }\n    protos, err := ps.GetProtocols(pid)\n    if err != nil || len(protos) == 0 {\n        return true  // terlalu permisif\n    }\n    for _, p := range protos {\n        if strings.HasPrefix(p, SyncProtocolPrefix) {\n            return true\n        }\n    }\n    return false\n}\n```\n\n## Impact\nPeer yang tidak support sync tetap diseret ke sync attempt. Waste resource, potensi error.\n\n## Suggested Fix\n```go\nfunc peerMaySupportSync(h host.Host, pid peer.ID) bool {\n    ps := h.Peerstore()\n    if ps == nil {\n        return false  // lebih konservatif\n    }\n    protos, err := ps.GetProtocols(pid)\n    if err != nil {\n        logging.Debugf(\"sync: failed to get protocols for %s: %v\", pid, err)\n        return false\n    }\n    if len(protos) == 0 {\n        return false\n    }\n    for _, p := range protos {\n        if strings.HasPrefix(p, SyncProtocolPrefix) {\n            return true\n        }\n    }\n    return false\n}\n```","patch_refs":[],"thread":[{"id":13381,"source":"github","source_ref":"7026796998","author":"XE desk","team":true,"body":"Thanks for the report. We read it against the code and could not confirm a bug in what it describes.\n\nThis report is closed as invalid. If we have missed something, file a new report that links\nhttps://bounty.xe.network/XE-13293 and says what; it is read like any other.","created_at":"2026-11-20T00:49:42+00:00"}]}