mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Add -con_elementswitness flag and global variable
This commit is contained in:
parent
01b03a9206
commit
6ed8fd8ab0
6 changed files with 14 additions and 2 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include <chainparamsseeds.h>
|
#include <chainparamsseeds.h>
|
||||||
#include <consensus/merkle.h>
|
#include <consensus/merkle.h>
|
||||||
|
#include <primitives/transaction.h>
|
||||||
#include <tinyformat.h>
|
#include <tinyformat.h>
|
||||||
#include <util.h>
|
#include <util.h>
|
||||||
#include <utilstrencodings.h>
|
#include <utilstrencodings.h>
|
||||||
|
|
@ -523,9 +524,10 @@ class CCustomParams : public CRegTestParams {
|
||||||
consensus.max_block_signature_size = gArgs.GetArg("-con_max_block_sig_size", 74);
|
consensus.max_block_signature_size = gArgs.GetArg("-con_max_block_sig_size", 74);
|
||||||
g_signed_blocks = gArgs.GetBoolArg("-con_signed_blocks", true);
|
g_signed_blocks = gArgs.GetBoolArg("-con_signed_blocks", true);
|
||||||
|
|
||||||
// Note: This global is needed to avoid circular dependency
|
// Note: These globals are needed to avoid circular dependencies.
|
||||||
// Defaults to true for custom chains.
|
// Default to true for custom chains.
|
||||||
g_con_blockheightinheader = args.GetBoolArg("-con_blockheightinheader", true);
|
g_con_blockheightinheader = args.GetBoolArg("-con_blockheightinheader", true);
|
||||||
|
g_con_elementswitness = args.GetBoolArg("-con_elementswitness", true);
|
||||||
|
|
||||||
// No subsidy for custom chains by default
|
// No subsidy for custom chains by default
|
||||||
consensus.genesis_subsidy = args.GetArg("-con_blocksubsidy", 0);
|
consensus.genesis_subsidy = args.GetArg("-con_blocksubsidy", 0);
|
||||||
|
|
|
||||||
|
|
@ -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_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_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_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_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=<style>", "Use genesis style <style> (default: elements). Results in genesis block compatibility with various networks. Allowed values: elements, bitcoin", true, OptionsCategory::ELEMENTS);
|
gArgs.AddArg("-con_genesis_style=<style>", "Use genesis style <style> (default: elements). Results in genesis block compatibility with various networks. Allowed values: elements, bitcoin", true, OptionsCategory::ELEMENTS);
|
||||||
gArgs.AddArg("-con_signed_blocks", "Signed blockchain. Uses input of `-signblockscript` to define what signatures are necessary to solve it.", false, OptionsCategory::CHAINPARAMS);
|
gArgs.AddArg("-con_signed_blocks", "Signed blockchain. Uses input of `-signblockscript` to define what signatures are necessary to solve it.", false, OptionsCategory::CHAINPARAMS);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
#include <serialize.h>
|
#include <serialize.h>
|
||||||
#include <uint256.h>
|
#include <uint256.h>
|
||||||
|
|
||||||
|
// ELEMENTS:
|
||||||
|
// Globals to avoid circular dependencies.
|
||||||
extern bool g_con_blockheightinheader;
|
extern bool g_con_blockheightinheader;
|
||||||
extern bool g_signed_blocks;
|
extern bool g_signed_blocks;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
#include <tinyformat.h>
|
#include <tinyformat.h>
|
||||||
#include <utilstrencodings.h>
|
#include <utilstrencodings.h>
|
||||||
|
|
||||||
|
bool g_con_elementswitness = false;
|
||||||
|
|
||||||
std::string COutPoint::ToString() const
|
std::string COutPoint::ToString() const
|
||||||
{
|
{
|
||||||
return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10), n);
|
return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0,10), n);
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,10 @@
|
||||||
|
|
||||||
static const int SERIALIZE_TRANSACTION_NO_WITNESS = 0x40000000;
|
static const int SERIALIZE_TRANSACTION_NO_WITNESS = 0x40000000;
|
||||||
|
|
||||||
|
// ELEMENTS:
|
||||||
|
// Globals to avoid circular dependencies.
|
||||||
|
extern bool g_con_elementswitness;
|
||||||
|
|
||||||
/** An outpoint - a combination of a transaction hash and an index n into its vout */
|
/** An outpoint - a combination of a transaction hash and an index n into its vout */
|
||||||
class COutPoint
|
class COutPoint
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -307,6 +307,7 @@ def initialize_datadir(dirname, n, chain):
|
||||||
f.write("con_connect_coinbase=0\n")
|
f.write("con_connect_coinbase=0\n")
|
||||||
f.write("anyonecanspendaremine=0\n")
|
f.write("anyonecanspendaremine=0\n")
|
||||||
f.write("con_blockheightinheader=0\n")
|
f.write("con_blockheightinheader=0\n")
|
||||||
|
f.write("con_elementswitness=0\n")
|
||||||
f.write("con_signed_blocks=0\n")
|
f.write("con_signed_blocks=0\n")
|
||||||
f.write("multi_data_permitted=0\n")
|
f.write("multi_data_permitted=0\n")
|
||||||
f.write("walletrbf=0\n") # Default is 1 in Elements
|
f.write("walletrbf=0\n") # Default is 1 in Elements
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue