mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 394651ff10 into merged_master (Bitcoin PR bitcoin/bitcoin#29996)
This commit is contained in:
commit
bd96c8be93
2 changed files with 35 additions and 5 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue