diff options
author | Suhas Daftuar <sdaftuar@chaincode.com> | 2023-05-04 14:08:37 -0400 |
---|---|---|
committer | James O'Beirne <james.obeirne@pm.me> | 2023-09-30 05:45:37 -0400 |
commit | b73d3bbd23220857bf17cbb6401275bf58013b72 (patch) | |
tree | c068b3dc31d50bba653c92386b12b2274feed167 /src/validation.cpp | |
parent | 5bbf735defac20f58133bea95226e13a5d8209bc (diff) | |
download | bitcoin-b73d3bbd23220857bf17cbb6401275bf58013b72.tar.xz |
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>
Diffstat (limited to 'src/validation.cpp')
-rw-r--r-- | src/validation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index 357b4d422d..a12f121dc3 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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; } |