diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 6f545d8..c230e89 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -1159,6 +1159,28 @@ + + + + Client Name + + + + + + + Loading... + + + + + + + | + + + + diff --git a/src/rpc.cpp b/src/rpc.cpp index 7812521..4bcb2e8 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -612,6 +612,19 @@ void RPC::getInfoThenRefresh(bool force) { ui->solrate->setText(QString::number(solrate) % " Sol/s"); }); + // Get network info + payload = { + {"jsonrpc", "1.0"}, + {"id", "someid"}, + {"method", "getnetworkinfo"} + }; + + conn->doRPCIgnoreError(payload, [=](const json& reply) { + QString clientname = QString::fromStdString( reply["subversion"].get() ); + + ui->clientname->setText(clientname); + }); + // Call to see if the blockchain is syncing. payload = { {"jsonrpc", "1.0"}, @@ -621,6 +634,7 @@ void RPC::getInfoThenRefresh(bool force) { conn->doRPCIgnoreError(payload, [=](const json& reply) { auto progress = reply["verificationprogress"].get(); + // TODO: use getinfo.synced bool isSyncing = progress < 0.9999; // 99.99% int blockNumber = reply["blocks"].get();