Skip to content

Commit

Permalink
Merge 690fed6 into merged_master (Elements PR ElementsProject#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra committed Nov 4, 2020
2 parents 1da233c + 690fed6 commit 1692b4f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,9 @@ class CLiquidV1Params : public CChainParams {

g_con_blockheightinheader = true;
g_con_elementsmode = true;
// TODO: Pick appropriate value for this network.
consensus.total_valid_epochs = 2;


consensus.genesis_subsidy = 0;

Expand Down Expand Up @@ -753,6 +756,12 @@ class CLiquidV1Params : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;

// Not active yet.
consensus.vDeployments[Consensus::DEPLOYMENT_DYNA_FED].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_DYNA_FED].nStartTime = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_DYNA_FED].nTimeout = 0;


// Finally, create genesis block
genesis = CreateGenesisBlock(consensus, CScript() << commit, CScript(OP_RETURN), 1296688602, 2, 0x207fffff, 1, 0);
consensus.hashGenesisBlock = genesis.GetHash();
Expand Down
3 changes: 2 additions & 1 deletion src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ struct Params {
// Used to seed the extension space for first dynamic blocks
std::vector<std::vector<unsigned char>> first_extension_space;
// Used to allow M-epoch-old peg-in addresses as deposits
size_t total_valid_epochs;
// default 1 to not break legacy chains implicitly.
size_t total_valid_epochs = 1;
};
} // namespace Consensus

Expand Down
2 changes: 1 addition & 1 deletion src/pegins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ std::vector<std::pair<CScript, CScript>> GetValidFedpegScripts(const CBlockIndex
fedpegscripts.push_back(std::make_pair(GetScriptForDestination(ScriptHash(GetScriptForDestination(WitnessV0ScriptHash(params.fedpegScript)))), params.fedpegScript));
}
}
// Only return up to the latest two of three possible fedpegscripts, which are enforced
// Only return up to the latest total_valid_epochs fedpegscripts, which are enforced
fedpegscripts.resize(std::min(fedpegscripts.size(), params.total_valid_epochs));
return fedpegscripts;
}

0 comments on commit 1692b4f

Please sign in to comment.