Changeset View
Changeset View
Standalone View
Standalone View
src/validation.cpp
Show First 20 Lines • Show All 1,550 Lines • ▼ Show 20 Lines | |||||
static CCheckQueue<CScriptCheck> scriptcheckqueue(128); | static CCheckQueue<CScriptCheck> scriptcheckqueue(128); | ||||
void ThreadScriptCheck() { | void ThreadScriptCheck() { | ||||
RenameThread("bitcoin-scriptch"); | RenameThread("bitcoin-scriptch"); | ||||
scriptcheckqueue.Thread(); | scriptcheckqueue.Thread(); | ||||
} | } | ||||
VersionBitsCache versionbitscache GUARDED_BY(cs_main); | |||||
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, static_cast<Consensus::DeploymentPos>(i), | |||||
versionbitscache); | |||||
if (state == ThresholdState::LOCKED_IN || | |||||
state == ThresholdState::STARTED) { | |||||
nVersion |= VersionBitsMask( | |||||
params, static_cast<Consensus::DeploymentPos>(i)); | |||||
} | |||||
} | |||||
return nVersion; | return nVersion; | ||||
} | } | ||||
// Returns the script flags which should be checked for the block after | // Returns the script flags which should be checked for the block after | ||||
// the given block. | // the given block. | ||||
static uint32_t GetNextBlockScriptFlags(const Consensus::Params ¶ms, | static uint32_t GetNextBlockScriptFlags(const Consensus::Params ¶ms, | ||||
const CBlockIndex *pindex) { | const CBlockIndex *pindex) { | ||||
uint32_t flags = SCRIPT_VERIFY_NONE; | uint32_t flags = SCRIPT_VERIFY_NONE; | ||||
▲ Show 20 Lines • Show All 4,168 Lines • Show Last 20 Lines |