Browse Source

[Qt] ClientModel add method to get the height of the header chain

0.14
Jonas Schnelli 8 years ago
parent
commit
e47052f6b5
No known key found for this signature in database
GPG Key ID: 29D4BCB6416F53EC
  1. 8
      src/qt/clientmodel.cpp
  2. 1
      src/qt/clientmodel.h

8
src/qt/clientmodel.cpp

@ -68,6 +68,14 @@ int ClientModel::getNumBlocks() const @@ -68,6 +68,14 @@ int ClientModel::getNumBlocks() const
return chainActive.Height();
}
int ClientModel::getHeaderHeight() const
{
LOCK(cs_main);
if (!pindexBestHeader)
return 0;
return pindexBestHeader->nHeight;
}
quint64 ClientModel::getTotalBytesRecv() const
{
return CNode::GetTotalBytesRecv();

1
src/qt/clientmodel.h

@ -51,6 +51,7 @@ public: @@ -51,6 +51,7 @@ public:
//! Return number of connections, default is in- and outbound (total)
int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const;
int getNumBlocks() const;
int getHeaderHeight() const;
//! Return number of transactions in the mempool
long getMempoolSize() const;

Loading…
Cancel
Save