mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
blockheaders include block height, nodes validate it
The block height validation is gated by the startup option `con_blockheightinheader`, accesible in custom chains only using option `chain=<name>`. Only if set to true will this field be (de)serialized and evaluated in consensus logic. Otherwise the field is simply ignored, other than being stored in memory as the default value 0.
This commit is contained in:
parent
8f6bedfd4b
commit
2bfabb3e4f
23 changed files with 180 additions and 129 deletions
|
|
@ -435,6 +435,10 @@ class CCustomParams : public CRegTestParams {
|
|||
// No subsidy for custom chains by default
|
||||
consensus.genesis_subsidy = args.GetArg("-con_blocksubsidy", 0);
|
||||
|
||||
// Note: This global is needed to avoid circular dependency
|
||||
// Defaults to true for custom chains.
|
||||
g_con_blockheightinheader = gArgs.GetBoolArg("-con_blockheightinheader", true);
|
||||
|
||||
// All non-zero coinbase outputs must go to this scriptPubKey
|
||||
std::vector<unsigned char> man_bytes = ParseHex(gArgs.GetArg("-con_mandatorycoinbase", ""));
|
||||
consensus.mandatory_coinbase_destination = CScript(man_bytes.begin(), man_bytes.end()); // Blank script allows any coinbase destination
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue