Mining tab: option to start mining (solo or pool) when the wallet opens #47

Closed
opened 2026-10-28 01:24:37 +00:00 by btcbob · 2 comments
Owner

What: a "Start mining when the wallet opens" option on the Mining tab, with a choice of Solo or Pool, saved with the rest of the Mining tab settings.

Today: the Mining tab already remembers the pool, the pay-to address and the thread count, but it always opens stopped. The only way to auto-start is to hand-edit dobbscoin.conf (gen=1 + genproclimit=N for solo, stratum=host:port + stratumuser=<address> for pool). Most wallet users will never do that.

Proposed:

  • A checkbox plus a Solo / Pool choice, stored in QSettings next to poolMiningEndpoint / poolMiningAddress / poolMiningThreads.
  • Pool: at startup, use the saved endpoint, address and threads and go through the same path as the Start Pool Mining button (StartStratum), with the form locked the same way. Only offer it once a pay-to address has been saved, so it can never start paying nobody.
  • Solo: start GenerateDobbscoins with the saved thread count, but only after the initial sync is done (IsInitialBlockDownload() false). Mining on an old tip is wasted work. Status line: "Waiting for sync, then mining…".
  • One mode at a time. Solo and pool together just split the CPU.
  • Command line and dobbscoin.conf still win: if -gen or -stratum is given, the checkbox doesn't override it.
  • Unticking the box doesn't stop mining that's running now; it only changes what happens next start.
  • Default off. A wallet shouldn't start using the CPU on a fresh install without being asked.

Open question: should the thread count offered for auto-start default to one less than the core count, so the computer stays usable?

Files: src/qt/miningpage.cpp, src/qt/forms/miningpage.ui.

**What:** a "Start mining when the wallet opens" option on the Mining tab, with a choice of **Solo** or **Pool**, saved with the rest of the Mining tab settings. **Today:** the Mining tab already remembers the pool, the pay-to address and the thread count, but it always opens stopped. The only way to auto-start is to hand-edit `dobbscoin.conf` (`gen=1` + `genproclimit=N` for solo, `stratum=host:port` + `stratumuser=<address>` for pool). Most wallet users will never do that. **Proposed:** - A checkbox plus a Solo / Pool choice, stored in QSettings next to `poolMiningEndpoint` / `poolMiningAddress` / `poolMiningThreads`. - **Pool:** at startup, use the saved endpoint, address and threads and go through the same path as the Start Pool Mining button (`StartStratum`), with the form locked the same way. Only offer it once a pay-to address has been saved, so it can never start paying nobody. - **Solo:** start `GenerateDobbscoins` with the saved thread count, but only after the initial sync is done (`IsInitialBlockDownload()` false). Mining on an old tip is wasted work. Status line: "Waiting for sync, then mining…". - One mode at a time. Solo and pool together just split the CPU. - Command line and `dobbscoin.conf` still win: if `-gen` or `-stratum` is given, the checkbox doesn't override it. - Unticking the box doesn't stop mining that's running now; it only changes what happens next start. - **Default off.** A wallet shouldn't start using the CPU on a fresh install without being asked. **Open question:** should the thread count offered for auto-start default to one less than the core count, so the computer stays usable? Files: `src/qt/miningpage.cpp`, `src/qt/forms/miningpage.ui`.
Author
Owner

Built on branch feat/issue-47-mining-autostart (eecba7e8). Not merged yet.

The choice is a drop-down at the top of the Mining tab: When the wallet opens: Don't start mining / Start solo mining / Start pool mining. Default is don't. Pool is greyed out until an address has been saved by pool mining once.

On "caught up" for solo: I didn't use IsInitialBlockDownload(), because on this chain it stays true whenever the newest block is a day old (same reason miner.cpp skips it). Solo starts once a peer has been connected for 30 s and we have every block up to the best header we know of. On the open question, auto-start uses the thread counts already set on the tab, and the solo count is now saved too.

Tested headless on Linux (offscreen Qt, throwaway settings and datadirs):

  • solo + a peer: off for 30 s, then mining (regtest)
  • solo, no peers: never starts
  • solo chosen, -gen=0 on the command line: never starts (the command line wins)
  • nothing chosen: never starts
  • pool, mainnet: connected to pool.dobbscoin.info:3033 within a second, authorize accepted, jobs arriving

Not yet seen by a person: how the drop-down looks, and a Windows build.

Built on branch `feat/issue-47-mining-autostart` (eecba7e8). Not merged yet. The choice is a drop-down at the top of the Mining tab: **When the wallet opens: Don't start mining / Start solo mining / Start pool mining**. Default is don't. Pool is greyed out until an address has been saved by pool mining once. On "caught up" for solo: I didn't use `IsInitialBlockDownload()`, because on this chain it stays true whenever the newest block is a day old (same reason `miner.cpp` skips it). Solo starts once a peer has been connected for 30 s and we have every block up to the best header we know of. On the open question, auto-start uses the thread counts already set on the tab, and the solo count is now saved too. Tested headless on Linux (offscreen Qt, throwaway settings and datadirs): - solo + a peer: off for 30 s, then mining (regtest) - solo, no peers: never starts - solo chosen, `-gen=0` on the command line: never starts (the command line wins) - nothing chosen: never starts - pool, mainnet: connected to pool.dobbscoin.info:3033 within a second, authorize accepted, jobs arriving Not yet seen by a person: how the drop-down looks, and a Windows build.
Author
Owner

Tested on chaos (Debian 13) with a separate test wallet, both modes:

  • Pool: with "Start pool mining" set, the wallet connected to pool.dobbscoin.info:3033 on its own when it opened and the pool accepted the worker.
  • Solo: with "Start solo mining" set, closing and reopening the wallet from the desktop icon started the miner by itself 77 seconds after launch. It has found 9 blocks since.

Merged into main as eecba7e8 (fast-forward). Closing.

Tested on chaos (Debian 13) with a separate test wallet, both modes: - **Pool:** with "Start pool mining" set, the wallet connected to pool.dobbscoin.info:3033 on its own when it opened and the pool accepted the worker. - **Solo:** with "Start solo mining" set, closing and reopening the wallet from the desktop icon started the miner by itself 77 seconds after launch. It has found 9 blocks since. Merged into `main` as eecba7e8 (fast-forward). Closing.
btcbob referenced this issue from a commit 2026-11-11 01:46:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
SubGeniusFinance/dobbscoin-source#47
No description provided.