diff --git a/netsync/manager.go b/netsync/manager.go index 24e1ef1feeb..826891e6ffb 100644 --- a/netsync/manager.go +++ b/netsync/manager.go @@ -409,12 +409,6 @@ func (sm *SyncManager) startSync() { // Start syncing from the best peer if one was selected. if bestPeer != nil { - if !sm.headersFirstMode { - // Clear the requestedBlocks if the sync peer changes, otherwise - // we may ignore blocks we need that the last sync peer failed - // to send. - sm.requestedBlocks = make(map[chainhash.Hash]struct{}) - } locator, err := sm.chain.LatestBlockLocator() if err != nil { log.Errorf("Failed to get block locator for the "+ @@ -452,6 +446,10 @@ func (sm *SyncManager) startSync() { "%d from peer %s", best.Height+1, sm.nextCheckpoint.Height, bestPeer.Addr()) } else { + // Clear the requestedBlocks if the sync peer changes, otherwise + // we may ignore blocks we need that the last sync peer failed + // to send. + sm.requestedBlocks = make(map[chainhash.Hash]struct{}) bestPeer.PushGetBlocksMsg(locator, &zeroHash) } sm.syncPeer = bestPeer