From c4c1bc7db2d517e672b4106bbfc3d503f76fc870 Mon Sep 17 00:00:00 2001 From: ericscalibur Date: Thu, 30 Jul 2026 00:57:19 +0000 Subject: [PATCH] main: make /gen actually mine nMineMode defaults to MINE_RELAY (0) and ParseStartupArguments() never changed it, so a node started with /gen would spawn ThreadBitcoinMiner, enter BitcoinMiner(), hit if (nMineMode == MINE_RELAY) return true; and return before doing any work. The node then ran indefinitely looking completely healthy -- it synced, it held peers, it reported no errors -- while earning nothing. Nothing in the log said otherwise; the only hint was `nMineMode = 0` in a startup line that reads like a status echo. This affects every headless miner, because the GUI is the only other way to select a mining mode. /gen now implies MINE_SOLO unless /operator or /participant asked for something else. Verify with `nMineMode = 1` at startup. Co-Authored-By: Claude Opus 5 --- src/main_gui.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main_gui.cpp b/src/main_gui.cpp index a94d01d..c64dca9 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -79,7 +79,15 @@ static void ParseStartupArguments(int argc, char* argv[]) fDebug = true; if (arg(argc,argv,"/gen") || arg(argc,argv,"-gen")) + { fGenerateBitcoins = 1; + // Mining mode defaults to MINE_RELAY, and nothing in this parser ever + // changed it, so BitcoinMiner() returned immediately at its relay guard + // and /gen mined nothing at all. /operator and /participant still set + // their own mode below, so only the unqualified case is affected. + if (nMineMode == MINE_RELAY) + nMineMode = MINE_SOLO; + } if (arg(argc,argv,"/solomine") || arg(argc,argv,"-solomine")) fSoloMineTest = true;