From 3307124a2b8ec22e4544bad94ddb60279fed07bf Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 6 Feb 2017 23:29:07 -0800 Subject: [PATCH] Add parameter interaction, where zrpcunsafe implies zrpc --- src/init.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 55bf6655d..7d5ffe9e6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -378,7 +378,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-stopafterblockimport", strprintf("Stop running after importing blocks from disk (default: %u)", 0)); } string debugCategories = "addrman, alert, bench, coindb, db, estimatefee, lock, mempool, net, partitioncheck, pow, proxy, prune, " - "rand, reindex, rpc, selectcoins, zrpc, zrpcunsafe"; // Don't translate these and qt below + "rand, reindex, rpc, selectcoins, zrpc, zrpcunsafe (implies zrpc)"; // Don't translate these and qt below if (mode == HMM_BITCOIN_QT) debugCategories += ", qt"; strUsage += HelpMessageOpt("-debug=", strprintf(_("Output debugging information (default: %u, supplying is optional)"), 0) + ". " + @@ -802,6 +802,15 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) if (GetBoolArg("-nodebug", false) || find(categories.begin(), categories.end(), string("0")) != categories.end()) fDebug = false; + // Special case: if debug=zrpcunsafe, implies debug=zrpc, so add it to debug categories + if (find(categories.begin(), categories.end(), string("zrpcunsafe")) != categories.end()) { + if (find(categories.begin(), categories.end(), string("zrpc")) == categories.end()) { + LogPrintf("%s: parameter interaction: -debug=zrpcunsafe -> -debug=zrpc\n", __func__); + vector& v = mapMultiArgs["-debug"]; + v.push_back("zrpc"); + } + } + // Check for -debugnet if (GetBoolArg("-debugnet", false)) InitWarning(_("Warning: Unsupported argument -debugnet ignored, use -debug=net."));