From 39112e1eaaebee8623411509b0586bfec54121f8 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Thu, 15 Apr 2021 16:46:45 +0000 Subject: [PATCH 01/10] correct copy/paste error in error message --- src/validation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index da086153dd..472bd4b0ff 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3760,7 +3760,7 @@ static bool ContextualCheckDynaFedHeader(const CBlockHeader& block, BlockValidat int fedpeg_version = 0; std::vector fedpeg_program; if (!proposed.m_fedpeg_program.IsWitnessProgram(fedpeg_version, fedpeg_program)) { - return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "invalid-dyna-fed", "proposed signblockscript must be native segwit scriptPubkey"); + return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "invalid-dyna-fed", "proposed fedpeg program must be native segwit scriptPubkey"); } // for v0, fedpegscript's scriptPubKey must match. v1+ is unencumbered. From 0045cafd7559fa98eb32802410b51719a42dcb75 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Thu, 15 Apr 2021 17:03:29 +0000 Subject: [PATCH 02/10] rpc/mining: restore code erroneously dropped in 0e2c963dbfedbe5c22f08e9f1aecc62882bfdbea --- src/rpc/mining.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index bba0ced02a..495e0e54c5 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -130,7 +130,7 @@ static bool GenerateBlock(ChainstateManager& chainman, CBlock& block, uint64_t& ++block.nNonce; --max_tries; } - if (max_tries == 0) { + if (max_tries == 0 || ShutdownRequested()) { return false; } if (block.nNonce == std::numeric_limits::max()) { From 257374744742eab4aae173a3bdaf04f687a47123 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Thu, 15 Apr 2021 17:06:13 +0000 Subject: [PATCH 03/10] fix test code duplication from 3a0de44d90bf8a01d3f7431fd849e8b63b1e951f --- test/functional/test_framework/util.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 285147a321..eeb1d9baac 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -502,12 +502,9 @@ def gen_return_txouts(): txouts = [] from .messages import CTxOut, CTxOutValue txout = CTxOut() - txout.nValue = 0 + txout.nValue = CTxOutValue(0) txout.scriptPubKey = hex_str_to_bytes(script_pubkey) for _ in range(128): - txout = CTxOut() - txout.nValue = CTxOutValue(0) - txout.scriptPubKey = hex_str_to_bytes(script_pubkey) txouts.append(txout) return txouts From 1f3cfb451a2dd7446de844110baba2b89863a498 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Thu, 15 Apr 2021 17:09:11 +0000 Subject: [PATCH 04/10] chainparamsbase: fix bool-vs-enum mistake in 9c3480fea96abe7cc1adbdb2c754cce0224b23fa --- src/chainparamsbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index 19c85b832d..6acec8efae 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -40,7 +40,7 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman) argsman.AddArg("-con_connect_genesis_outputs", "Connect outputs in genesis block to utxo database.", ArgsManager::ALLOW_ANY, OptionsCategory::ELEMENTS); argsman.AddArg("-con_elementsmode", "Use Elements-like instead of Core-like witness encoding. This is required for CA/CT. (default: true)", ArgsManager::ALLOW_ANY, OptionsCategory::ELEMENTS); argsman.AddArg("-con_blockheightinheader", "Whether the chain includes the block height directly in the header, for easier validation of block height in low-resource environments. (default: true)", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); - argsman.AddArg("-con_genesis_style=