Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 219 Lines • ▼ Show 20 Lines | bool ReceivedBlockTransactions(const CBlock &block, CValidationState &state, | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
bool RollforwardBlock(const CBlockIndex *pindex, CCoinsViewCache &inputs, | bool RollforwardBlock(const CBlockIndex *pindex, CCoinsViewCache &inputs, | ||||
const Consensus::Params ¶ms); | const Consensus::Params ¶ms); | ||||
} g_chainstate; | } g_chainstate; | ||||
/** | /** | ||||
* Global state | * Global state | ||||
* | |||||
* Mutex to guard access to validation specific variables, such as reading | |||||
* or changing the chainstate. | |||||
* | |||||
* This may also need to be locked when updating the transaction pool, e.g. on | |||||
* AcceptToMemoryPool. See CTxMemPool::cs comment for details. | |||||
* | |||||
* The transaction pool has a separate lock to allow reading from it and the | |||||
* chainstate at the same time. | |||||
*/ | */ | ||||
CCriticalSection cs_main; | RecursiveMutex cs_main; | ||||
BlockMap &mapBlockIndex = g_chainstate.mapBlockIndex; | BlockMap &mapBlockIndex = g_chainstate.mapBlockIndex; | ||||
CChain &chainActive = g_chainstate.chainActive; | CChain &chainActive = g_chainstate.chainActive; | ||||
CBlockIndex *pindexBestHeader = nullptr; | CBlockIndex *pindexBestHeader = nullptr; | ||||
Mutex g_best_block_mutex; | Mutex 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; | ||||
int nScriptCheckThreads = 0; | int nScriptCheckThreads = 0; | ||||
▲ Show 20 Lines • Show All 5,520 Lines • Show Last 20 Lines |