Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | const std::vector<std::string> CHECKLEVEL_DOC{ | ||||
"level 0 reads the blocks from disk", | "level 0 reads the blocks from disk", | ||||
"level 1 verifies block validity", | "level 1 verifies block validity", | ||||
"level 2 verifies undo data", | "level 2 verifies undo data", | ||||
"level 3 checks disconnection of tip blocks", | "level 3 checks disconnection of tip blocks", | ||||
"level 4 tries to reconnect the blocks", | "level 4 tries to reconnect the blocks", | ||||
"each level includes the checks of the previous levels", | "each level includes the checks of the previous levels", | ||||
}; | }; | ||||
ChainstateManager g_chainman; | |||||
CChainState &ChainstateActive() { | |||||
LOCK(::cs_main); | |||||
assert(g_chainman.m_active_chainstate); | |||||
return *g_chainman.m_active_chainstate; | |||||
} | |||||
CChain &ChainActive() { | |||||
LOCK(::cs_main); | |||||
return ::ChainstateActive().m_chain; | |||||
} | |||||
/** | /** | ||||
* Global state | * Global state | ||||
* | * | ||||
* Mutex to guard access to validation specific variables, such as reading | * Mutex to guard access to validation specific variables, such as reading | ||||
* or changing the chainstate. | * or changing the chainstate. | ||||
* | * | ||||
* This may also need to be locked when updating the transaction pool, e.g. on | * This may also need to be locked when updating the transaction pool, e.g. on | ||||
* AcceptToMemoryPool. See CTxMemPool::cs comment for details. | * AcceptToMemoryPool. See CTxMemPool::cs comment for details. | ||||
▲ Show 20 Lines • Show All 6,242 Lines • Show Last 20 Lines |