File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2015,26 +2015,13 @@ void Chainstate::InitCoinsCache(size_t cache_size_bytes)
20152015//
20162016bool ChainstateManager::IsInitialBlockDownload () const
20172017{
2018- // Optimization: pre-test latch before taking the lock.
2019- if (m_cached_finished_ibd.load (std::memory_order_relaxed))
2020- return false ;
2021-
2022- LOCK (cs_main);
20232018 if (m_cached_finished_ibd.load (std::memory_order_relaxed))
20242019 return false ;
20252020 if (m_blockman.LoadingBlocks ()) {
20262021 return true ;
20272022 }
2028- CChain& chain{ActiveChain ()};
2029- if (chain.Tip () == nullptr ) {
2030- return true ;
2031- }
2032- if (chain.Tip ()->nChainWork < MinimumChainWork ()) {
2023+ if (!m_cached_chaintip_recent)
20332024 return true ;
2034- }
2035- if (chain.Tip ()->Time () < Now<NodeSeconds>() - m_options.max_tip_age ) {
2036- return true ;
2037- }
20382025 LogInfo (" Leaving InitialBlockDownload (latching to false)" );
20392026 m_cached_finished_ibd.store (true , std::memory_order_relaxed);
20402027 return false ;
You can’t perform that action at this time.
0 commit comments