Skip to content

Commit 200a392

Browse files
instagibbsstevenroose
authored andcommitted
Fix liquidv1 sync
A single field wasn't given a positive value which meant it considers no peg-ins to be valid.
1 parent 8161038 commit 200a392

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/chainparams.cpp

Lines changed: 3 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

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)