Skip to content

Commit e47052f

Browse files
committed
[Qt] ClientModel add method to get the height of the header chain
1 parent a001f18 commit e47052f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/qt/clientmodel.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ int ClientModel::getNumBlocks() const
6868
return chainActive.Height();
6969
}
7070

71+
int ClientModel::getHeaderHeight() const
72+
{
73+
LOCK(cs_main);
74+
if (!pindexBestHeader)
75+
return 0;
76+
return pindexBestHeader->nHeight;
77+
}
78+
7179
quint64 ClientModel::getTotalBytesRecv() const
7280
{
7381
return CNode::GetTotalBytesRecv();

src/qt/clientmodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class ClientModel : public QObject
5151
//! Return number of connections, default is in- and outbound (total)
5252
int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const;
5353
int getNumBlocks() const;
54+
int getHeaderHeight() const;
5455

5556
//! Return number of transactions in the mempool
5657
long getMempoolSize() const;

0 commit comments

Comments
 (0)