aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2020-10-16 09:41:09 +0200
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-10-16 11:12:08 +0200
commit2947ae6f85d40baa8ac0d2180b181c60708ad0ba (patch)
treed38fbf46c191559342513527807653f7e33a941d /src
parent82d3596dfe4ef4fd2c582d05540f93450b49d092 (diff)
parentfa723e3d43e63e8424d97d21d8f2cc8136aba206 (diff)
Merge #20035: signet: Fix uninitialized read in validation
fa723e3d43e63e8424d97d21d8f2cc8136aba206 Initialize default-initialized uint256 consensus params to zero explicitly (MarcoFalke) fa729cdb2cee26850663746517e136e5317b121f doc: Move assumed-values doxygen comments to header (MarcoFalke) fa64892b8296208380341c2c1d8c3f6c1a915475 signet: Fix uninitialized read in validation (MarcoFalke) Pull request description: ACKs for top commit: practicalswift: re-ACK fa723e3d43e63e8424d97d21d8f2cc8136aba206: patch still looks correct kallewoof: ReACK fa723e3d43e63e8424d97d21d8f2cc8136aba206 theStack: re-ACK fa723e3d43e63e8424d97d21d8f2cc8136aba206 🍐 Tree-SHA512: db562bcc15af23bbcbf485f0bbf7564c64c144a4368230fd7682e8861d9500f6f5240351e31c560140df43b2e8456eafd9d27d1e8dd682b20afcc279a39dc329
Diffstat (limited to 'src')
-rw-r--r--src/chainparams.cpp18
-rw-r--r--src/consensus/params.h2
2 files changed, 9 insertions, 11 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp
index a34bf350fc..7998357bc7 100644
--- a/src/chainparams.cpp
+++ b/src/chainparams.cpp
@@ -91,10 +91,7 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = 1199145601; // January 1, 2008
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = 1230767999; // December 31, 2008
- // The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000e1ab5ec9348e9f4b8eb8154");
-
- // By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x0000000000000000000f2adce67e49b0b6bdeb9de8b7c3d7e93b21e7fc1e819d"); // 623950
/**
@@ -207,10 +204,7 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = 1199145601; // January 1, 2008
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = 1230767999; // December 31, 2008
- // The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000001495c1d5a01e2af8a23");
-
- // By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x000000000000056c49030c174179b52a928c870e6e8a822c75973b7970cfbd01"); // 1692000
pchMessageStart[0] = 0x0b;
@@ -297,6 +291,8 @@ public:
}
bin = ParseHex(signet_challenge[0]);
+ consensus.nMinimumChainWork = uint256{};
+ consensus.defaultAssumeValid = uint256{};
m_assumed_blockchain_size = 0;
m_assumed_chain_state_size = 0;
chainTxData = ChainTxData{
@@ -315,7 +311,9 @@ public:
consensus.signet_blocks = true;
consensus.signet_challenge.assign(bin.begin(), bin.end());
consensus.nSubsidyHalvingInterval = 210000;
+ consensus.BIP16Exception = uint256{};
consensus.BIP34Height = 1;
+ consensus.BIP34Hash = uint256{};
consensus.BIP65Height = 1;
consensus.BIP66Height = 1;
consensus.CSVHeight = 1;
@@ -326,6 +324,7 @@ public:
consensus.fPowNoRetargeting = false;
consensus.nRuleChangeActivationThreshold = 1916;
consensus.nMinerConfirmationWindow = 2016;
+ consensus.MinBIP9WarningHeight = 0;
consensus.powLimit = uint256S("00000377ae000000000000000000000000000000000000000000000000000000");
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
@@ -394,11 +393,8 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
- // The best chain should have at least this much work.
- consensus.nMinimumChainWork = uint256S("0x00");
-
- // By default assume that the signatures in ancestors of this block are valid.
- consensus.defaultAssumeValid = uint256S("0x00");
+ consensus.nMinimumChainWork = uint256{};
+ consensus.defaultAssumeValid = uint256{};
pchMessageStart[0] = 0xfa;
pchMessageStart[1] = 0xbf;
diff --git a/src/consensus/params.h b/src/consensus/params.h
index 932f0d2c60..0983595c6a 100644
--- a/src/consensus/params.h
+++ b/src/consensus/params.h
@@ -79,7 +79,9 @@ struct Params {
int64_t nPowTargetSpacing;
int64_t nPowTargetTimespan;
int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; }
+ /** The best chain should have at least this much work */
uint256 nMinimumChainWork;
+ /** By default assume that the signatures in ancestors of this block are valid */
uint256 defaultAssumeValid;
/**