<!-- XE-13296 · [net/sync.go] M10: syncPeer() tidak cek apakah peer sudah sync — sync berulang tidak perlu · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13296>. The page is the record; this is the same page for reading.*

XE-13296 · Bounty

# \[net/sync.go\] M10: syncPeer() tidak cek apakah peer sudah sync — sync berulang tidak perlu

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

- [557518](https://bounty.xe.network/log/557518) 2026-11-20 00:49 UTC reply.mirrored
- [557084](https://bounty.xe.network/log/557084) 2026-11-20 00:48 UTC reply.sent
- [554899](https://bounty.xe.network/log/554899) 2026-11-20 00:37 UTC github.state\_pushed
- [554886](https://bounty.xe.network/log/554886) 2026-11-20 00:37 UTC github.labels
- [553356](https://bounty.xe.network/log/553356) 2026-11-20 00:33 UTC proposal.adopted
- [553163](https://bounty.xe.network/log/553163) 2026-11-20 00:33 UTC proposal.adopted
- [553162](https://bounty.xe.network/log/553162) 2026-11-20 00:33 UTC ticket.status new → closed
- [552761](https://bounty.xe.network/log/552761) 2026-11-20 00:33 UTC proposal.adopted
- [552760](https://bounty.xe.network/log/552760) 2026-11-20 00:33 UTC ticket.facts area
- [552756](https://bounty.xe.network/log/552756) 2026-11-20 00:33 UTC proposal.adopted
- [552755](https://bounty.xe.network/log/552755) 2026-11-20 00:33 UTC ticket.facts
- [550837](https://bounty.xe.network/log/550837) 2026-11-20 00:31 UTC note.added

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

### Report

## Ringkasan

`syncPeer` tidak cek apakah peer tersebut sudah sync. Kalau `SyncAll` dipanggil berulang, peer yang sudah sync tetap diseret. Waste resource.

## Lokasi

- File: `net/sync.go`
- Lines: 248-274

## Kode

```
func (t *tracker) syncPeer(ctx context.Context, h host.Host, pid peer.ID, opts ...SyncOption) error {
    ...
    // tidak ada check apakah peer sudah sync
    if err := t.doFullSync(ctx, h, pid, opts...); err != nil {
        return err
    }
    return nil
}
```

## Impact

Sync berulang tidak perlu. Waste resource.

## Suggested Fix

```
func (t *tracker) syncPeer(ctx context.Context, h host.Host, pid peer.ID, opts ...SyncOption) error {
    ...
    t.mu.RLock()
    lastSync := t.lastSync[pid]
    t.mu.RUnlock()

    if time.Since(lastSync) < opts.syncInterval {
        return nil  // skip jika baru saja sync
    }

    if err := t.doFullSync(ctx, h, pid, opts...); err != nil {
        return err
    }
    return nil
}
```

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