aboutsummaryrefslogtreecommitdiff
path: root/src/qt/clientmodel.h
diff options
context:
space:
mode:
authorJonas Schnelli <[email protected]>2017-04-19 18:45:11 +0200
committerJonas Schnelli <[email protected]>2017-05-31 10:53:46 +0200
commit1e936d7e8760de230377f4e4af5eb68368f1f550 (patch)
tree1401150ebd408ce6b5ff2d8f8c1025396e3704a4 /src/qt/clientmodel.h
parentCheck interruptNet during dnsseed lookups (diff)
downloaddiscoin-1e936d7e8760de230377f4e4af5eb68368f1f550.tar.xz
discoin-1e936d7e8760de230377f4e4af5eb68368f1f550.zip
Reduce cs_main locks during modal overlay by adding an atomic cache
Diffstat (limited to 'src/qt/clientmodel.h')
-rw-r--r--src/qt/clientmodel.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h
index 2c10e633b..6f7077dad 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<int> cachedBestHeaderHeight;
+ std::atomic<int64_t> cachedBestHeaderTime;
+
private:
OptionsModel *optionsModel;
PeerTableModel *peerTableModel;