mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
gui: Avoid redundant tx status updates
In TransactionTablePriv::index, avoid calling interfaces::Wallet::tryGetTxStatus if the status is up to date as of the most recent NotifyBlockTip notification. Store height from the most recent notification in a new ClientModel::cachedNumBlocks variable in order to check this. This avoids floods of IPC traffic from tryGetTxStatus with #10102 when there are a lot of transactions. It might also make the GUI a little more efficient even when there is no IPC.
This commit is contained in:
@@ -56,6 +56,7 @@ 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;
|
||||
|
||||
@@ -73,9 +74,10 @@ public:
|
||||
|
||||
bool getProxyInfo(std::string& ip_port) const;
|
||||
|
||||
// caches for the best header
|
||||
// caches for the best header, number of blocks
|
||||
mutable std::atomic<int> cachedBestHeaderHeight;
|
||||
mutable std::atomic<int64_t> cachedBestHeaderTime;
|
||||
mutable std::atomic<int> m_cached_num_blocks{-1};
|
||||
|
||||
private:
|
||||
interfaces::Node& m_node;
|
||||
|
||||
Reference in New Issue
Block a user