Mining tab: option to start mining (solo or pool) when the wallet opens #47
Labels
No labels
do-not-open-till-X-Day
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
SubGeniusFinance/dobbscoin-source#47
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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=Nfor solo,stratum=host:port+stratumuser=<address>for pool). Most wallet users will never do that.Proposed:
poolMiningEndpoint/poolMiningAddress/poolMiningThreads.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.GenerateDobbscoinswith 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…".dobbscoin.confstill win: if-genor-stratumis given, the checkbox doesn't override it.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.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 reasonminer.cppskips 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):
-gen=0on the command line: never starts (the command line wins)Not yet seen by a person: how the drop-down looks, and a Windows build.
Tested on chaos (Debian 13) with a separate test wallet, both modes:
Merged into
mainaseecba7e8(fast-forward). Closing.