Skip to content

Commit

Permalink
Merge pull request #2773 from jamescowens/enhance_registry_clear_para…
Browse files Browse the repository at this point in the history
…meters

init, registry: Support -clearallregistryhistory startup parameter
  • Loading branch information
jamescowens authored Jul 10, 2024
2 parents 36edb2f + 22743b2 commit ab044e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gridcoin/gridcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void InitializeContracts(CBlockIndex* pindexBest)
uiInterface.InitMessage(_("Loading history for contract type ") + tr_contract_type_string + "...");

std::string history_arg = "-clear" + GRC::Contract::Type::ToString(contract_type) + "history";
if (gArgs.GetBoolArg(history_arg, false)) {
if (gArgs.GetBoolArg(history_arg, false) || gArgs.GetBoolArg("-clearallregistryhistory", false)) {
registry.Reset();
}

Expand Down
6 changes: 5 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,13 +627,17 @@ void SetupServerArgs()
hidden_args.emplace_back("-activebeforesb");

// This puts hidden options in the form of -clear<type>history, where <type> is the contract types that have a
// registry with a backing db. This is currently beacon, project, protocol, and scraper.
// registry with a backing db. This is currently beacon, project, protocol, and scraper, with sidestakes starting
// at V13 height.
for (const auto& contract_type : GRC::RegistryBookmarks::CONTRACT_TYPES_WITH_REG_DB) {
std::string history_arg = "-clear" + GRC::Contract::Type::ToString(contract_type) + "history";

hidden_args.emplace_back(history_arg);
}

// Also allow the -clearallregistryhistory hidden argument to support clearing all of the registries.
hidden_args.emplace_back("-clearallregistryhistory");

// -boinckey should now be removed entirely. It is put here to prevent the executable erroring out on
// an invalid parameter for old clients that may have left the argument in.
hidden_args.emplace_back("-boinckey");
Expand Down

0 comments on commit ab044e8

Please sign in to comment.