From 6ed8fd8ab0f273c719f3f218a0c5df838353fed1 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Tue, 29 Jan 2019 12:24:13 +0000 Subject: [PATCH] Add -con_elementswitness flag and global variable --- src/chainparams.cpp | 6 ++++-- src/chainparamsbase.cpp | 1 + src/primitives/block.h | 2 ++ src/primitives/transaction.cpp | 2 ++ src/primitives/transaction.h | 4 ++++ test/bitcoin_functional/functional/test_framework/util.py | 1 + 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 738aa1211e..9d8c6ca12e 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -523,9 +524,10 @@ class CCustomParams : public CRegTestParams { consensus.max_block_signature_size = gArgs.GetArg("-con_max_block_sig_size", 74); g_signed_blocks = gArgs.GetBoolArg("-con_signed_blocks", true); - // Note: This global is needed to avoid circular dependency - // Defaults to true for custom chains. + // Note: These globals are needed to avoid circular dependencies. + // Default to true for custom chains. g_con_blockheightinheader = args.GetBoolArg("-con_blockheightinheader", true); + g_con_elementswitness = args.GetBoolArg("-con_elementswitness", true); // No subsidy for custom chains by default consensus.genesis_subsidy = args.GetArg("-con_blocksubsidy", 0); diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index bbbd166d80..44d3864230 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -26,6 +26,7 @@ void SetupChainParamsBaseOptions() gArgs.AddArg("-con_mandatorycoinbase", "All non-zero valued coinbase outputs must go to this scriptPubKey, if set.", false, OptionsCategory::ELEMENTS); gArgs.AddArg("-con_blocksubsidy", "Defines the amount of block subsidy to start with, at genesis block.", false, OptionsCategory::ELEMENTS); gArgs.AddArg("-con_connect_coinbase", "Connect outputs in genesis block to utxo database.", false, OptionsCategory::ELEMENTS); + gArgs.AddArg("-con_elementswitness", "Use Elements-like instead of Core-like witness encoding. This is required for CA/CT. (default: true)", false, OptionsCategory::ELEMENTS); gArgs.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)", false, OptionsCategory::CHAINPARAMS); gArgs.AddArg("-con_genesis_style=