diff options
| author | Eric <tilcboy44@gmail.com> | 2026-07-30 07:37:43 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-30 10:37:43 -0300 |
| commit | f30f45849ecd45be6a073b6b1d308e1c12b8b52b (patch) | |
| tree | 82b45db2a82d826318093bf9ed1427a57a9d2d78 /src | |
| parent | 6ecd5f75650bc86e3b1ccbdf2999ec31c43f551b (diff) | |
main: make /gen actually mine (#42)
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 <noreply@anthropic.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/main_gui.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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[]) | |||
| 79 | fDebug = true; | 79 | fDebug = true; |
| 80 | 80 | ||
| 81 | if (arg(argc,argv,"/gen") || arg(argc,argv,"-gen")) | 81 | if (arg(argc,argv,"/gen") || arg(argc,argv,"-gen")) |
| 82 | { | ||
| 82 | fGenerateBitcoins = 1; | 83 | fGenerateBitcoins = 1; |
| 84 | // Mining mode defaults to MINE_RELAY, and nothing in this parser ever | ||
| 85 | // changed it, so BitcoinMiner() returned immediately at its relay guard | ||
| 86 | // and /gen mined nothing at all. /operator and /participant still set | ||
| 87 | // their own mode below, so only the unqualified case is affected. | ||
| 88 | if (nMineMode == MINE_RELAY) | ||
| 89 | nMineMode = MINE_SOLO; | ||
| 90 | } | ||
| 83 | 91 | ||
| 84 | if (arg(argc,argv,"/solomine") || arg(argc,argv,"-solomine")) | 92 | if (arg(argc,argv,"/solomine") || arg(argc,argv,"-solomine")) |
| 85 | fSoloMineTest = true; | 93 | fSoloMineTest = true; |