|
@ -856,13 +856,22 @@ void RPC::getInfoThenRefresh(bool force) { |
|
|
// Get mining info
|
|
|
// Get mining info
|
|
|
// This is better+faster than calling multiple RPCs such as getlocalsolps/getnetworksolps/getgenerate
|
|
|
// This is better+faster than calling multiple RPCs such as getlocalsolps/getnetworksolps/getgenerate
|
|
|
// and getlocalsolps returns non-zero values even when not mining, which is not what we want
|
|
|
// and getlocalsolps returns non-zero values even when not mining, which is not what we want
|
|
|
if(isdragonx) { |
|
|
|
|
|
conn->doRPCIgnoreError(makePayload("getmininginfo"), [=](const QJsonValue& reply) { |
|
|
conn->doRPCIgnoreError(makePayload("getmininginfo"), [=](const QJsonValue& reply) { |
|
|
QString localhashps = QString::number( reply["localhashps"].toDouble() ); |
|
|
QString localhashps = QString::number( reply["localhashps"].toDouble() ); |
|
|
QString networkhashps = QString::number( reply["networkhashps"].toDouble() ); |
|
|
QString networkhashps = QString::number( reply["networkhashps"].toDouble() ); |
|
|
QString generate = QString::number( reply["generate"].toBool() ); |
|
|
QString generate = QString::number( reply["generate"].toBool() ); |
|
|
QString difficulty = QString::number( reply["difficulty"].toDouble() ); |
|
|
QString difficulty = QString::number( reply["difficulty"].toDouble() ); |
|
|
QString genproclimit = QString::number( reply["genproclimit"].toInt() ); |
|
|
QString genproclimit = QString::number( reply["genproclimit"].toInt() ); |
|
|
|
|
|
|
|
|
|
|
|
// Update network hashrate in "Node Info" tab
|
|
|
|
|
|
if(isdragonx) { |
|
|
|
|
|
ui->solrate->setText(QString::number(networkhashps.toDouble()) % " Hash/s"); |
|
|
|
|
|
} else { |
|
|
|
|
|
ui->solrate->setText(QString::number(networkhashps.toDouble() / 1000000) % " MegaSol/s"); |
|
|
|
|
|
// The rest of this callback is for DRAGONX
|
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if ( genproclimit == "-1" ) { |
|
|
if ( genproclimit == "-1" ) { |
|
|
// Showing users they are mining with -1 threads by default is confusing
|
|
|
// Showing users they are mining with -1 threads by default is confusing
|
|
|
genproclimit = QString::number(0); |
|
|
genproclimit = QString::number(0); |
|
@ -889,13 +898,6 @@ void RPC::getInfoThenRefresh(bool force) { |
|
|
DEBUG("enabled start mining button, disabled stop mining button"); |
|
|
DEBUG("enabled start mining button, disabled stop mining button"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Update network hashrate in "Node Info" tab
|
|
|
|
|
|
if(isdragonx) { |
|
|
|
|
|
ui->solrate->setText(QString::number(networkhashps.toDouble()) % " Hash/s"); |
|
|
|
|
|
} else { |
|
|
|
|
|
ui->solrate->setText(QString::number(networkhashps.toDouble() / 1000000) % " MegaSol/s"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// find a QLCDNumber child of tabWidget named localhashrate
|
|
|
// find a QLCDNumber child of tabWidget named localhashrate
|
|
|
auto localhashrate = ui->tabWidget->findChild<QLCDNumber *>("localhashrate"); |
|
|
auto localhashrate = ui->tabWidget->findChild<QLCDNumber *>("localhashrate"); |
|
|
if(localhashrate != nullptr) { |
|
|
if(localhashrate != nullptr) { |
|
@ -953,7 +955,6 @@ void RPC::getInfoThenRefresh(bool force) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Get network info
|
|
|
// Get network info
|
|
|
conn->doRPCIgnoreError(makePayload("getnetworkinfo"), [=](const QJsonValue& reply) { |
|
|
conn->doRPCIgnoreError(makePayload("getnetworkinfo"), [=](const QJsonValue& reply) { |
|
|