Generalize the number of epochs old a peg-in can be and still be valid

This commit is contained in:
Gregory Sanders 2019-08-19 15:21:30 -04:00
parent b105ff45e5
commit f7905d6dfb
5 changed files with 22 additions and 16 deletions

View file

@ -134,6 +134,7 @@ public:
g_signed_blocks = false;
g_con_elementsmode = false;
g_con_blockheightinheader = false;
consensus.total_valid_epochs = 0;
/**
* The message start string is designed to be unlikely to occur in normal data.
@ -263,6 +264,7 @@ public:
g_signed_blocks = false;
g_con_elementsmode = false;
g_con_blockheightinheader = false;
consensus.total_valid_epochs = 0;
pchMessageStart[0] = 0x0b;
pchMessageStart[1] = 0x11;
@ -366,6 +368,7 @@ public:
g_signed_blocks = false;
g_con_elementsmode = false;
g_con_blockheightinheader = false;
consensus.total_valid_epochs = 0;
pchMessageStart[0] = 0xfa;
pchMessageStart[1] = 0xbf;
@ -582,6 +585,8 @@ class CCustomParams : public CRegTestParams {
uint256 entropy;
GenerateAssetEntropy(entropy, COutPoint(uint256(commit), 0), parentGenesisBlockHash);
consensus.total_valid_epochs = args.GetArg("-total_valid_epochs", 2);
// Elements serialization uses derivation, bitcoin serialization uses 0x00
if (g_con_elementsmode) {
CalculateAsset(consensus.pegged_asset, entropy);