{"id":"XE-13296","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"441","source_url":"https://github.com/xeprotocol/xe/issues/441","reporter_id":2483,"title":"[net/sync.go] M10: syncPeer() tidak cek apakah peer sudah sync — sync berulang tidak perlu","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.693298+00:00","updated_at":"2026-11-20T00:51:16.319593+00:00","source_created_at":"2026-11-12T02:52:19+00:00","told_at":"2026-11-20T00:49:39+00:00","status_changed_at":"2026-11-20T00:33:26.129113+00:00","url":"https://bounty.xe.network/XE-13296","body":"## Ringkasan\n`syncPeer` tidak cek apakah peer tersebut sudah sync. Kalau `SyncAll` dipanggil berulang, peer yang sudah sync tetap diseret. Waste resource.\n\n## Lokasi\n- File: `net/sync.go`\n- Lines: 248-274\n\n## Kode\n```go\nfunc (t *tracker) syncPeer(ctx context.Context, h host.Host, pid peer.ID, opts ...SyncOption) error {\n    ...\n    // tidak ada check apakah peer sudah sync\n    if err := t.doFullSync(ctx, h, pid, opts...); err != nil {\n        return err\n    }\n    return nil\n}\n```\n\n## Impact\nSync berulang tidak perlu. Waste resource.\n\n## Suggested Fix\n```go\nfunc (t *tracker) syncPeer(ctx context.Context, h host.Host, pid peer.ID, opts ...SyncOption) error {\n    ...\n    t.mu.RLock()\n    lastSync := t.lastSync[pid]\n    t.mu.RUnlock()\n    \n    if time.Since(lastSync) < opts.syncInterval {\n        return nil  // skip jika baru saja sync\n    }\n    \n    if err := t.doFullSync(ctx, h, pid, opts...); err != nil {\n        return err\n    }\n    return nil\n}\n```","patch_refs":[],"thread":[{"id":13378,"source":"github","source_ref":"7026795951","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-13296 and says what; it is read like any other.","created_at":"2026-11-20T00:49:39+00:00"}]}