mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-08 13:49:35 +02:00
Remove direct bitcoin calls from qt/clientmodel.cpp
This commit is contained in:
committed by
John Newbery
parent
5fba3af21e
commit
fe6f27e6ea
@@ -14,6 +14,7 @@
|
||||
#include <qt/platformstyle.h>
|
||||
#include <qt/walletmodel.h>
|
||||
#include <chainparams.h>
|
||||
#include <interface/node.h>
|
||||
#include <netbase.h>
|
||||
#include <rpc/server.h>
|
||||
#include <rpc/client.h>
|
||||
@@ -566,13 +567,14 @@ void RPCConsole::setClientModel(ClientModel *model)
|
||||
setNumConnections(model->getNumConnections());
|
||||
connect(model, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
|
||||
|
||||
setNumBlocks(model->getNumBlocks(), model->getLastBlockDate(), model->getVerificationProgress(nullptr), false);
|
||||
interface::Node& node = clientModel->node();
|
||||
setNumBlocks(node.getNumBlocks(), QDateTime::fromTime_t(node.getLastBlockTime()), node.getVerificationProgress(), false);
|
||||
connect(model, SIGNAL(numBlocksChanged(int,QDateTime,double,bool)), this, SLOT(setNumBlocks(int,QDateTime,double,bool)));
|
||||
|
||||
updateNetworkState();
|
||||
connect(model, SIGNAL(networkActiveChanged(bool)), this, SLOT(setNetworkActive(bool)));
|
||||
|
||||
updateTrafficStats(model->getTotalBytesRecv(), model->getTotalBytesSent());
|
||||
updateTrafficStats(node.getTotalBytesRecv(), node.getTotalBytesSent());
|
||||
connect(model, SIGNAL(bytesChanged(quint64,quint64)), this, SLOT(updateTrafficStats(quint64, quint64)));
|
||||
|
||||
connect(model, SIGNAL(mempoolSizeChanged(long,size_t)), this, SLOT(setMempoolSize(long,size_t)));
|
||||
@@ -835,7 +837,7 @@ void RPCConsole::updateNetworkState()
|
||||
connections += tr("In:") + " " + QString::number(clientModel->getNumConnections(CONNECTIONS_IN)) + " / ";
|
||||
connections += tr("Out:") + " " + QString::number(clientModel->getNumConnections(CONNECTIONS_OUT)) + ")";
|
||||
|
||||
if(!clientModel->getNetworkActive()) {
|
||||
if(!clientModel->node().getNetworkActive()) {
|
||||
connections += " (" + tr("Network activity disabled") + ")";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user