mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Move ::nMaxTipAge into ChainstateManager
This commit is contained in:
parent
ba441d493c
commit
faf44876db
8 changed files with 53 additions and 14 deletions
|
|
@ -123,7 +123,6 @@ uint256 g_best_block;
|
|||
bool g_parallel_script_checks{false};
|
||||
bool fCheckBlockIndex = false;
|
||||
bool fCheckpointsEnabled = DEFAULT_CHECKPOINTS_ENABLED;
|
||||
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;
|
||||
|
||||
uint256 hashAssumeValid;
|
||||
arith_uint256 nMinimumChainWork;
|
||||
|
|
@ -1548,8 +1547,9 @@ bool Chainstate::IsInitialBlockDownload() const
|
|||
return true;
|
||||
if (m_chain.Tip()->nChainWork < nMinimumChainWork)
|
||||
return true;
|
||||
if (m_chain.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge))
|
||||
if (m_chain.Tip()->Time() < NodeClock::now() - m_chainman.m_options.max_tip_age) {
|
||||
return true;
|
||||
}
|
||||
LogPrintf("Leaving InitialBlockDownload (latching to false)\n");
|
||||
m_cached_finished_ibd.store(true, std::memory_order_relaxed);
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue