aboutsummaryrefslogtreecommitdiff
path: root/src/test/versionbits_tests.cpp
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2022-03-11 19:26:49 +1000
committerAnthony Towns <aj@erisian.com.au>2022-04-05 14:35:15 +1000
commitc4c5b9ca6e98cf44309af73edf5559940a04d00f (patch)
tree146f5e873868c9e62609119d322b439e12ef5661 /src/test/versionbits_tests.cpp
parent47bac475f044da0d8cd2e1f39fd2894f90dd0bd9 (diff)
consensus/params: set default values for BIP9Deployment
While chainparams should explicilty set values for each possible entry in vDeployments, in the past that has been missed resulting in potential undefined behaviour due to accessing unitinitialized data. Reduce the severity of future bugs of that nature by providing benign default values. Adds a unit test to alert if the default value is not overwritten for the real chains (NEVER_ACTIVE/NEVER_ACTIVE rather than NEVER_ACTIVE/NO_TIMEOUT).
Diffstat (limited to 'src/test/versionbits_tests.cpp')
-rw-r--r--src/test/versionbits_tests.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/versionbits_tests.cpp b/src/test/versionbits_tests.cpp
index bf87812a8a..d86a0fe046 100644
--- a/src/test/versionbits_tests.cpp
+++ b/src/test/versionbits_tests.cpp
@@ -275,6 +275,7 @@ static void check_computeblockversion(const Consensus::Params& params, Consensus
nStartTime == Consensus::BIP9Deployment::NEVER_ACTIVE)
{
BOOST_CHECK_EQUAL(min_activation_height, 0);
+ BOOST_CHECK_EQUAL(nTimeout, Consensus::BIP9Deployment::NO_TIMEOUT);
return;
}