mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
net_processing: Request assumeutxo background chain blocks
Add new PeerManagerImpl::TryDownloadingHistoricalBlocks method and use it to request background chain blocks in addition to blocks normally requested by FindNextBlocksToDownload. Co-authored-by: Ryan Ofsky <ryan@ofsky.org> Co-authored-by: James O'Beirne <james.obeirne@gmail.com>
This commit is contained in:
committed by
James O'Beirne
parent
5bbf735def
commit
b73d3bbd23
@@ -4148,6 +4148,12 @@ bool ChainstateManager::ProcessNewBlock(const std::shared_ptr<const CBlock>& blo
|
||||
return error("%s: ActivateBestChain failed (%s)", __func__, state.ToString());
|
||||
}
|
||||
|
||||
Chainstate* bg_chain{WITH_LOCK(cs_main, return BackgroundSyncInProgress() ? m_ibd_chainstate.get() : nullptr)};
|
||||
BlockValidationState bg_state;
|
||||
if (bg_chain && !bg_chain->ActivateBestChain(bg_state, block)) {
|
||||
return error("%s: [background] ActivateBestChain failed (%s)", __func__, bg_state.ToString());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user