aboutsummaryrefslogtreecommitdiff
path: root/src/qt/clientmodel.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-07-19 15:50:50 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2016-08-26 09:53:09 +0200
commite47052f6b5ea901ecdc1cb8245dd98a98b06618a (patch)
tree36ce56606cc4ce302091412264196a9df86a6705 /src/qt/clientmodel.cpp
parenta001f1880283089d3eb0aa83e889d9707d79fd5f (diff)
[Qt] ClientModel add method to get the height of the header chain
Diffstat (limited to 'src/qt/clientmodel.cpp')
-rw-r--r--src/qt/clientmodel.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 30f412dd23..e3240b95a2 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -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();