Skip to content

Commit c94f176

Browse files
authored
Merge pull request duality-solutions#271 from crackcomm/v2.4-WIP-miner
GUI mining page switch fix
2 parents 5524dba + ceb5ae8 commit c94f176

File tree

4 files changed

+137
-181
lines changed

4 files changed

+137
-181
lines changed

src/miner/internal/miners-controller.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ MinersController::MinersController(MinerContextRef ctx)
2424

2525
void MinersController::Start()
2626
{
27+
_connected = _ctx->connman().GetNodeCount(CConnman::CONNECTIONS_ALL) >= 2;
2728
_enable_start = true;
2829
_signals = std::make_shared<MinerSignals>(this);
2930
// initialize block template
3031
_ctx->shared->RecreateBlock();
32+
LogPrintf("MinersController::Start can_start = %v\n", can_start());
3133

3234
if (can_start()) {
3335
_group_cpu.Start();
@@ -65,9 +67,9 @@ MinerSignals::MinerSignals(MinersController* ctr)
6567

6668
void MinerSignals::NotifyNode(const CNode* node)
6769
{
68-
if (g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) >= 2) {
70+
if (_ctr->ctx()->connman().GetNodeCount(CConnman::CONNECTIONS_ALL) >= 2) {
6971
_ctr->_connected = true;
70-
} else if (g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) <= 1) {
72+
} else if (_ctr->ctx()->connman().GetNodeCount(CConnman::CONNECTIONS_ALL) <= 1) {
7173
_ctr->_connected = false;
7274
}
7375
};

0 commit comments

Comments
 (0)