Merge 394651ff10 into merged_master (Bitcoin PR bitcoin/bitcoin#29996)

This commit is contained in:
ikripaka 2026-03-05 15:54:24 +00:00
commit bd96c8be93
No known key found for this signature in database
2 changed files with 35 additions and 5 deletions

View file

@ -6325,10 +6325,13 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
// before the background chainstate to prioritize getting to network tip.
FindNextBlocksToDownload(*peer, get_inflight_budget(), vToDownload, staller);
if (m_chainman.BackgroundSyncInProgress() && !IsLimitedPeer(*peer)) {
// If the background tip is not an ancestor of the snapshot block,
// we need to start requesting blocks from their last common ancestor.
const CBlockIndex *from_tip = LastCommonAncestor(m_chainman.GetBackgroundSyncTip(), m_chainman.GetSnapshotBaseBlock());
TryDownloadingHistoricalBlocks(
*peer,
get_inflight_budget(),
vToDownload, m_chainman.GetBackgroundSyncTip(),
vToDownload, from_tip,
Assert(m_chainman.GetSnapshotBaseBlock()));
}
for (const CBlockIndex *pindex : vToDownload) {