Skip to content

Commit 8a6af4c

Browse files
committed
Merge #722: [0.18 backport] Fix liquidv1 sync #720
9e1c98e Don't activate dynafed like custom chains (Gregory Sanders) 200a392 Fix liquidv1 sync (Gregory Sanders) Pull request description: Backport of Fix liquidv1 sync #720 Tree-SHA512: 564653f70d9dbdc63ac5dcff97c2f4a676dcafa61056604043edf05e331e7de70b2df07b9c8be93ae8fad43bf557ddd0eb848d031b04e40f6a26ba923eb94e79
2 parents 8161038 + 9e1c98e commit 8a6af4c

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/chainparams.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,9 @@ class CLiquidV1Params : public CChainParams {
719719

720720
g_con_blockheightinheader = true;
721721
g_con_elementsmode = true;
722+
// TODO: Pick appropriate value for this network.
723+
consensus.total_valid_epochs = 2;
724+
722725

723726
consensus.genesis_subsidy = 0;
724727

@@ -780,6 +783,12 @@ class CLiquidV1Params : public CChainParams {
780783
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
781784
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
782785

786+
// Not active yet.
787+
consensus.vDeployments[Consensus::DEPLOYMENT_DYNA_FED].bit = 0;
788+
consensus.vDeployments[Consensus::DEPLOYMENT_DYNA_FED].nStartTime = 0;
789+
consensus.vDeployments[Consensus::DEPLOYMENT_DYNA_FED].nTimeout = 0;
790+
791+
783792
// Finally, create genesis block
784793
genesis = CreateGenesisBlock(consensus, CScript(commit), CScript(OP_RETURN), 1296688602, 2, 0x207fffff, 1, 0);
785794
consensus.hashGenesisBlock = genesis.GetHash();

src/consensus/params.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ struct Params {
106106
// Used to seed the extension space for first dynamic blocks
107107
std::vector<std::vector<unsigned char>> first_extension_space;
108108
// Used to allow M-epoch-old peg-in addresses as deposits
109-
size_t total_valid_epochs;
109+
// default 1 to not break legacy chains implicitly.
110+
size_t total_valid_epochs = 1;
110111
};
111112
} // namespace Consensus
112113

src/pegins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ std::vector<std::pair<CScript, CScript>> GetValidFedpegScripts(const CBlockIndex
492492
fedpegscripts.push_back(std::make_pair(GetScriptForDestination(ScriptHash(GetScriptForDestination(WitnessV0ScriptHash(params.fedpegScript)))), params.fedpegScript));
493493
}
494494
}
495-
// Only return up to the latest two of three possible fedpegscripts, which are enforced
495+
// Only return up to the latest total_valid_epochs fedpegscripts, which are enforced
496496
fedpegscripts.resize(std::min(fedpegscripts.size(), params.total_valid_epochs));
497497
return fedpegscripts;
498498
}

0 commit comments

Comments
 (0)