Skip to content

Commit 526023a

Browse files
ajtownssipa
authored andcommitted
Improve handling of BIP9Deployment limits
Small tweaks by Pieter Wuille.
1 parent 6157e8c commit 526023a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/chainparams.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,13 @@ class CRegTestParams : public CChainParams {
283283
consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
284284
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
285285
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
286-
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 999999999999ULL;
286+
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
287287
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
288288
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 0;
289-
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 999999999999ULL;
289+
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
290290
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
291291
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 0;
292-
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 999999999999ULL;
292+
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
293293

294294
// The best chain should have at least this much work.
295295
consensus.nMinimumChainWork = uint256S("0x00");

src/consensus/params.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#define BITCOIN_CONSENSUS_PARAMS_H
88

99
#include "uint256.h"
10+
#include <limits>
1011
#include <map>
1112
#include <string>
1213

@@ -31,6 +32,9 @@ struct BIP9Deployment {
3132
int64_t nStartTime;
3233
/** Timeout/expiry MedianTime for the deployment attempt. */
3334
int64_t nTimeout;
35+
36+
/** Constant for nTimeout very far in the future. */
37+
static constexpr int64_t NO_TIMEOUT = std::numeric_limits<int64_t>::max();
3438
};
3539

3640
/**

0 commit comments

Comments
 (0)