Add CHECKSEQUENCEVERIFY softfork through BIP9

This commit is contained in:
Pieter Wuille
2016-02-20 23:37:13 +01:00
committed by BtcDrak
parent 6ff0b9f96e
commit ee40924fef
4 changed files with 23 additions and 1 deletions

View File

@@ -2277,6 +2277,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY;
}
// Start enforcing CHECKSEQUENCEVERIFY using versionbits logic.
if (VersionBitsState(pindex->pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_CSV, versionbitscache) == THRESHOLD_ACTIVE) {
flags |= SCRIPT_VERIFY_CHECKSEQUENCEVERIFY;
}
int64_t nTime2 = GetTimeMicros(); nTimeForks += nTime2 - nTime1;
LogPrint("bench", " - Fork checks: %.2fms [%.2fs]\n", 0.001 * (nTime2 - nTime1), nTimeForks * 0.000001);