Skip to content

Commit 690fed6

Browse files
committed
Merge ElementsProject#720: Fix liquidv1 sync
85de70c Don't activate dynafed like custom chains (Gregory Sanders) b73ff4c Fix liquidv1 sync (Gregory Sanders) Pull request description: A single field wasn't given a positive value which meant it considers no peg-ins to be valid. This is something introduced by dynafed. I put in a guess placeholder, the important part is that it's > 0. Tree-SHA512: 5a70b282fcf3a47fb17181eafd74f6f5cc2209f18111d6ae21ca0cac50bf63e4864f694826902e1a9ca032f5686c537653fe080d42a5e6ca946354a74998ebf5
2 parents 1e5da20 + 85de70c commit 690fed6

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
@@ -725,6 +725,9 @@ class CLiquidV1Params : public CChainParams {
725725

726726
g_con_blockheightinheader = true;
727727
g_con_elementsmode = true;
728+
// TODO: Pick appropriate value for this network.
729+
consensus.total_valid_epochs = 2;
730+
728731

729732
consensus.genesis_subsidy = 0;
730733

@@ -786,6 +789,12 @@ class CLiquidV1Params : public CChainParams {
786789
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
787790
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
788791

792+
// Not active yet.
793+
consensus.vDeployments[Consensus::DEPLOYMENT_DYNA_FED].bit = 0;
794+
consensus.vDeployments[Consensus::DEPLOYMENT_DYNA_FED].nStartTime = 0;
795+
consensus.vDeployments[Consensus::DEPLOYMENT_DYNA_FED].nTimeout = 0;
796+
797+
789798
// Finally, create genesis block
790799
genesis = CreateGenesisBlock(consensus, CScript(commit), CScript(OP_RETURN), 1296688602, 2, 0x207fffff, 1, 0);
791800
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)