Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | const std::vector<std::string> CHECKLEVEL_DOC{ | ||||
"each level includes the checks of the previous levels", | "each level includes the checks of the previous levels", | ||||
}; | }; | ||||
GlobalMutex g_best_block_mutex; | GlobalMutex g_best_block_mutex; | ||||
std::condition_variable g_best_block_cv; | std::condition_variable g_best_block_cv; | ||||
uint256 g_best_block; | uint256 g_best_block; | ||||
bool fCheckBlockIndex = false; | bool fCheckBlockIndex = false; | ||||
bool fCheckpointsEnabled = DEFAULT_CHECKPOINTS_ENABLED; | bool fCheckpointsEnabled = DEFAULT_CHECKPOINTS_ENABLED; | ||||
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE; | |||||
BlockHash hashAssumeValid; | BlockHash hashAssumeValid; | ||||
arith_uint256 nMinimumChainWork; | arith_uint256 nMinimumChainWork; | ||||
BlockValidationOptions::BlockValidationOptions(const Config &config) | BlockValidationOptions::BlockValidationOptions(const Config &config) | ||||
: excessiveBlockSize(config.GetMaxBlockSize()), checkPoW(true), | : excessiveBlockSize(config.GetMaxBlockSize()), checkPoW(true), | ||||
checkMerkleRoot(true) {} | checkMerkleRoot(true) {} | ||||
▲ Show 20 Lines • Show All 1,048 Lines • ▼ Show 20 Lines | if (m_chainman.m_blockman.LoadingBlocks()) { | ||||
return true; | return true; | ||||
} | } | ||||
if (m_chain.Tip() == nullptr) { | if (m_chain.Tip() == nullptr) { | ||||
return true; | return true; | ||||
} | } | ||||
if (m_chain.Tip()->nChainWork < nMinimumChainWork) { | if (m_chain.Tip()->nChainWork < nMinimumChainWork) { | ||||
return true; | return true; | ||||
} | } | ||||
if (m_chain.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge)) { | if (m_chain.Tip()->Time() < | ||||
Now<NodeSeconds>() - m_chainman.m_options.max_tip_age) { | |||||
return true; | return true; | ||||
} | } | ||||
LogPrintf("Leaving InitialBlockDownload (latching to false)\n"); | LogPrintf("Leaving InitialBlockDownload (latching to false)\n"); | ||||
m_cached_finished_ibd.store(true, std::memory_order_relaxed); | m_cached_finished_ibd.store(true, std::memory_order_relaxed); | ||||
return false; | return false; | ||||
} | } | ||||
static void AlertNotify(const std::string &strMessage) { | static void AlertNotify(const std::string &strMessage) { | ||||
▲ Show 20 Lines • Show All 5,348 Lines • Show Last 20 Lines |