Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 1,901 Lines • ▼ Show 20 Lines | void ThreadScriptCheck() { | ||||
scriptcheckqueue.Thread(); | scriptcheckqueue.Thread(); | ||||
} | } | ||||
// Protected by cs_main | // Protected by cs_main | ||||
VersionBitsCache versionbitscache; | VersionBitsCache versionbitscache; | ||||
int32_t ComputeBlockVersion(const CBlockIndex *pindexPrev, | int32_t ComputeBlockVersion(const CBlockIndex *pindexPrev, | ||||
const Consensus::Params ¶ms) { | const Consensus::Params ¶ms) { | ||||
LOCK(cs_main); | |||||
int32_t nVersion = VERSIONBITS_TOP_BITS; | int32_t nVersion = VERSIONBITS_TOP_BITS; | ||||
for (int i = 0; i < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; i++) { | |||||
ThresholdState state = VersionBitsState( | |||||
pindexPrev, params, (Consensus::DeploymentPos)i, versionbitscache); | |||||
if (state == THRESHOLD_LOCKED_IN || state == THRESHOLD_STARTED) { | |||||
nVersion |= VersionBitsMask(params, (Consensus::DeploymentPos)i); | |||||
} | |||||
} | |||||
return nVersion; | return nVersion; | ||||
} | } | ||||
// Returns the script flags which should be checked for a given block | // Returns the script flags which should be checked for a given block | ||||
static uint32_t GetBlockScriptFlags(const Config &config, | static uint32_t GetBlockScriptFlags(const Config &config, | ||||
const CBlockIndex *pChainTip) { | const CBlockIndex *pChainTip) { | ||||
AssertLockHeld(cs_main); | AssertLockHeld(cs_main); | ||||
const Consensus::Params &consensusParams = | const Consensus::Params &consensusParams = | ||||
▲ Show 20 Lines • Show All 3,630 Lines • Show Last 20 Lines |