Skip to content

Commit 65343ec

Browse files
mzumsandealfonsoromanz
authored andcommitted
p2p: Start downloading historical blocks from common ancestor
Otherwise, if the background tip is not an ancestor of the snapshot, blocks in between that ancestor up to the height of the background tip will never be requested.
1 parent 53f714d commit 65343ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/net_processing.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,8 @@ void PeerManagerImpl::TryDownloadingHistoricalBlocks(const Peer& peer, unsigned
15331533
// complete history beneath the snapshot base.
15341534
return;
15351535
}
1536-
1536+
// If the background tip is not an ancestor of the snapshot block, we need to start requesting blocks from their last common ancestor.
1537+
from_tip = LastCommonAncestor(from_tip, target_block);
15371538
FindNextBlocks(vBlocks, peer, state, from_tip, count, std::min<int>(from_tip->nHeight + BLOCK_DOWNLOAD_WINDOW, target_block->nHeight));
15381539
}
15391540

0 commit comments

Comments
 (0)