From 7148f5e7d755fc2084f53fa22c0761d73c042fbd Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Wed, 19 Apr 2017 18:45:11 +0200 Subject: Reduce cs_main locks during modal overlay by adding an atomic cache --- src/qt/clientmodel.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/qt/clientmodel.h') diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index 2c10e633b8..6f7077dad6 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -51,8 +51,8 @@ public: //! Return number of connections, default is in- and outbound (total) int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const; int getNumBlocks() const; - int getHeaderTipHeight() const; - int64_t getHeaderTipTime() const; + int getHeaderTipHeight(); + int64_t getHeaderTipTime(); //! Return number of transactions in the mempool long getMempoolSize() const; //! Return the dynamic memory usage of the mempool @@ -81,6 +81,10 @@ public: QString formatClientStartupTime() const; QString dataDir() const; + // caches for the best header + std::atomic cachedBestHeaderHeight; + std::atomic cachedBestHeaderTime; + private: OptionsModel *optionsModel; PeerTableModel *peerTableModel; -- cgit v1.2.3