aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-03-14 18:20:03 +0100
committerMacroFake <falke.marco@gmail.com>2022-06-22 09:54:15 +0200
commitfa1fe2e5004a6bacded464ed9778ff196e05859c (patch)
tree30474456f56ca292bd370c7c46672b6b30a59266 /src/validation.cpp
parente3b06e8dd8982155a97cfd090c01d06455a3c84d (diff)
Remove LOCKTIME_MEDIAN_TIME_PAST constant
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index b775c85912..f0b97c6b70 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -3491,15 +3491,15 @@ static bool ContextualCheckBlock(const CBlock& block, BlockValidationState& stat
const int nHeight = pindexPrev == nullptr ? 0 : pindexPrev->nHeight + 1;
// Enforce BIP113 (Median Time Past).
- int nLockTimeFlags = 0;
+ bool enforce_locktime_median_time_past{false};
if (DeploymentActiveAfter(pindexPrev, chainman, Consensus::DEPLOYMENT_CSV)) {
assert(pindexPrev != nullptr);
- nLockTimeFlags |= LOCKTIME_MEDIAN_TIME_PAST;
+ enforce_locktime_median_time_past = true;
}
- int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST)
- ? pindexPrev->GetMedianTimePast()
- : block.GetBlockTime();
+ const int64_t nLockTimeCutoff{enforce_locktime_median_time_past ?
+ pindexPrev->GetMedianTimePast() :
+ block.GetBlockTime()};
// Check that all transactions are finalized
for (const auto& tx : block.vtx) {