aboutsummaryrefslogtreecommitdiff
path: root/src/qt/clientmodel.h
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2020-01-23 19:31:16 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2020-05-23 20:02:04 -0300
commit2f867203b0c7a4438ce484be4cfa2b29dbf1abf0 (patch)
treee8db2784b603a7c802625cef6db7d18b0a4236ad /src/qt/clientmodel.h
parentcfe22a5f9e1d9e2d3dc8ce177e6c8eb04bc96615 (diff)
downloadbitcoin-2f867203b0c7a4438ce484be4cfa2b29dbf1abf0.tar.xz
Added best block hash to the NotifyHeaderTip and NotifyBlockTip signals.
[ClientModel] best header/block hash cached.
Diffstat (limited to 'src/qt/clientmodel.h')
-rw-r--r--src/qt/clientmodel.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h
index ace77f5972..aa324bc9ea 100644
--- a/src/qt/clientmodel.h
+++ b/src/qt/clientmodel.h
@@ -10,6 +10,8 @@
#include <atomic>
#include <memory>
+#include <sync.h>
+#include <uint256.h>
class BanTableModel;
class CBlockIndex;
@@ -57,6 +59,7 @@ public:
//! Return number of connections, default is in- and outbound (total)
int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const;
int getNumBlocks() const;
+ uint256 getBestBlockHash();
int getHeaderTipHeight() const;
int64_t getHeaderTipTime() const;
@@ -79,6 +82,9 @@ public:
mutable std::atomic<int64_t> cachedBestHeaderTime;
mutable std::atomic<int> m_cached_num_blocks{-1};
+ Mutex m_cached_tip_mutex;
+ uint256 m_cached_tip_blocks GUARDED_BY(m_cached_tip_mutex){};
+
private:
interfaces::Node& m_node;
std::unique_ptr<interfaces::Handler> m_handler_show_progress;