Skip to content

Commit

Permalink
GLEEC_OLD: exception to fix following the notarizations (#82)
Browse files Browse the repository at this point in the history
* GLEEC_OLD: exception to fix following the notarizations

* timeshifting transient verb

---------

Co-authored-by: smk762 <[email protected]>
  • Loading branch information
DeckerSU and smk762 authored Oct 18, 2024
1 parent 57adff7 commit a2352f2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions src/komodo_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,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;

Expand Down Expand Up @@ -1567,6 +1576,7 @@ void komodo_args(char *argv0)
else
ASSETCHAINS_P2PPORT = tmpport;

// TODO: if daemon launched with -datadir, but it's not created, the loop below will be endless loop (!)
char* dirname = nullptr;
while ( (dirname= (char *)GetDataDir(false).string().c_str()) == 0 || dirname[0] == 0 )
{
Expand Down Expand Up @@ -1724,6 +1734,7 @@ void komodo_args(char *argv0)
CCENABLE(EVAL_DICE);
CCENABLE(EVAL_ORACLES);
}

}
else
BITCOIND_RPCPORT = GetArg("-rpcport", BaseParams().RPCPort());
Expand Down
8 changes: 7 additions & 1 deletion src/qt/komodoapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,13 @@ int main(int argc, char *argv[])
}

void komodo_args(char *argv0);
komodo_args(argv[0]);
try {
komodo_args(argv[0]);
} catch (const std::exception& e) {
QMessageBox::critical(0, QObject::tr(PACKAGE_NAME),
QObject::tr("Error: %1").arg(e.what()));
return EXIT_FAILURE;
}
void chainparams_commandline();
chainparams_commandline();

Expand Down

0 comments on commit a2352f2

Please sign in to comment.