aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBtcDrak <btcdrak@gmail.com>2016-02-16 16:37:43 +0000
committerBtcDrak <btcdrak@gmail.com>2016-03-18 09:28:40 +0000
commit9713ed3015da02b0132b665e965fd591689e6510 (patch)
tree8b58ae7903ae9159e1898f3b500d3b0df38b485a
parent648be9b442587cc1682052bca80625aea906a01d (diff)
Soft fork logic for BIP68
-rw-r--r--src/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 3035a3e5dd..14f70cdf5f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2277,9 +2277,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY;
}
- // Start enforcing CHECKSEQUENCEVERIFY using versionbits logic.
+ // Start enforcing BIP68 (sequence locks) and BIP112 (CHECKSEQUENCEVERIFY) using versionbits logic.
+ int nLockTimeFlags = 0;
if (VersionBitsState(pindex->pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_CSV, versionbitscache) == THRESHOLD_ACTIVE) {
flags |= SCRIPT_VERIFY_CHECKSEQUENCEVERIFY;
+ nLockTimeFlags |= LOCKTIME_VERIFY_SEQUENCE;
}
int64_t nTime2 = GetTimeMicros(); nTimeForks += nTime2 - nTime1;
@@ -2290,7 +2292,6 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
CCheckQueueControl<CScriptCheck> control(fScriptChecks && nScriptCheckThreads ? &scriptcheckqueue : NULL);
std::vector<int> prevheights;
- int nLockTimeFlags = 0;
CAmount nFees = 0;
int nInputs = 0;
unsigned int nSigOps = 0;