From 820fe50424c2f84725ef9cc6dd87d885cd3c5b5e Mon Sep 17 00:00:00 2001 From: DeckerSU Date: Thu, 17 Oct 2024 15:07:38 +0200 Subject: [PATCH] GLEEC_OLD: exception to fix following the notarizations (#637) * GLEEC_OLD: exception to fix following the notarizations This configuration assumes that we have the `~/.komodo/GLEEC_OLD` directory for the old GLEEC chain. The daemon should be launched with `-datadir=$HOME/.komodo/GLEEC_OLD`, and the data directory should contain `GLEEC.conf` along with a symlink to it named `GLEEC_OLD.conf`. * timeshifting transient verb --------- Co-authored-by: smk762 --- src/chainparams.cpp | 3 +++ src/komodo_utils.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 2b94d935e6..343d57679c 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -951,6 +951,9 @@ const CChainParams::CCheckpointData GetACCheckPoints() // Check for GLEEC chain with old and new parameters if (chainName.ToString() == "GLEEC") { if (ASSETCHAINS_SUPPLY == 210000000 && ASSETCHAINS_STAKED == 100) { /* old GLEEC */ + ClearDatadirCache(); + chainName = assetchain("GLEEC_OLD"); /* exception to fix following notarizations, + we shouldn't do things like that! */ return checkpointDataGLEECOld; } return checkpointDataDefault; // TODO: return new checkpoints, when we will have enough data diff --git a/src/komodo_utils.cpp b/src/komodo_utils.cpp index 17c88ee4ff..3964e28f94 100644 --- a/src/komodo_utils.cpp +++ b/src/komodo_utils.cpp @@ -1006,6 +1006,15 @@ void komodo_args(char *argv0) uint16_t nonz=0; // keep track of # CCs enabled int32_t extralen = 0; + // prevent starting old GLEEC chain without datadir specified + if (GetArg("-ac_name","") == "GLEEC" && GetArg("-ac_supply",10) == 210000000 && GetArg("-ac_staked",0) == 100) { + if (mapArgs.count("-datadir") == 0) { + const std::string strOldGLEECStartUpError = "It's mandatory to launch old GLEEC chain with -datadir specified!"; + std::cerr << strOldGLEECStartUpError << std::endl; + throw std::runtime_error(strOldGLEECStartUpError); + } + } + const std::string ntz_dest_path = GetArg("-notary", ""); IS_KOMODO_NOTARY = ntz_dest_path == "" ? 0 : 1;