Only print out randomx debug stuff when -debug=randomx

This commit is contained in:
Duke Leto
2022-07-11 18:33:10 -04:00
parent 66e9bd835a
commit a70897966a
5 changed files with 59 additions and 37 deletions

View File

@@ -512,7 +512,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-stopafterblockimport", strprintf("Stop running after importing blocks from disk (default: %u)", 0));
strUsage += HelpMessageOpt("-nuparams=hexBranchId:activationHeight", "Use given activation height for specified network upgrade (regtest-only)");
}
string debugCategories = "addrman, alert, bench, coindb, db, deletetx, estimatefee, http, libevent, lock, mempool, net, tls, partitioncheck, pow, proxy, prune, rand, reindex, rpc, selectcoins, stratum, tor, zmq, zrpc, zrpcunsafe (implies zrpc)"; // Don't translate these
string debugCategories = "addrman, alert, bench, coindb, db, deletetx, estimatefee, http, libevent, lock, mempool, net, tls, partitioncheck, pow, proxy, prune, rand, randomx, reindex, rpc, selectcoins, stratum, tor, zmq, zrpc, zrpcunsafe (implies zrpc)"; // Don't translate these
strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +
_("If <category> is not supplied or if <category> = 1, output all debugging information.") + " " + _("<category> can be:") + " " + debugCategories + ".");
strUsage += HelpMessageOpt("-experimentalfeatures", _("Enable use of experimental features"));
@@ -1249,6 +1249,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
v.push_back("zrpc");
}
}
if (find(categories.begin(), categories.end(), string("randomx")) != categories.end()) {
fRandomXDebug = true;
fprintf(stderr,"%s: enabled randomx debug\n", __func__);
}
//fprintf(stderr,"%s tik5\n", __FUNCTION__);
// Check for -debugnet