diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-04-10 16:32:12 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-04-10 16:34:30 -0400 |
commit | 3eb8b1c3924c1d14c1a4234eb5360f32808b86dc (patch) | |
tree | 1d540ee7bb9c1fdd97f9c0785ceda74c9e34dc6f /src/qt/walletmodel.h | |
parent | 75917591c840ca61f5e2c6f5858e6882e834a911 (diff) | |
parent | 96cb597325f64cadb3cf43e2cdb3d7c1e2e49891 (diff) |
Merge #17905: gui: Avoid redundant tx status updates
96cb597325f64cadb3cf43e2cdb3d7c1e2e49891 gui: Avoid redundant tx status updates (Russell Yanofsky)
Pull request description:
This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10).
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.
ACKs for top commit:
promag:
Code review ACK 96cb597325f64cadb3cf43e2cdb3d7c1e2e49891.
hebasto:
ACK 96cb597325f64cadb3cf43e2cdb3d7c1e2e49891
Tree-SHA512: fce597bf52a813ad4923110d0a39229ea09e1631e0d580ea18cffb09e58cdbb4b111a40a9a9270ff16d8163cd47b0bd9f1fe7e3a6c7ebb19198f049f8dd1aa46
Diffstat (limited to 'src/qt/walletmodel.h')
-rw-r--r-- | src/qt/walletmodel.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 7936014af9..643cfc7fb9 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -24,6 +24,7 @@ enum class OutputType; class AddressTableModel; +class ClientModel; class OptionsModel; class PlatformStyle; class RecentRequestsTableModel; @@ -52,7 +53,7 @@ class WalletModel : public QObject Q_OBJECT public: - explicit WalletModel(std::unique_ptr<interfaces::Wallet> wallet, interfaces::Node& node, const PlatformStyle *platformStyle, OptionsModel *optionsModel, QObject *parent = nullptr); + explicit WalletModel(std::unique_ptr<interfaces::Wallet> wallet, ClientModel& client_model, const PlatformStyle *platformStyle, QObject *parent = nullptr); ~WalletModel(); enum StatusCode // Returned by sendCoins @@ -143,6 +144,7 @@ public: interfaces::Node& node() const { return m_node; } interfaces::Wallet& wallet() const { return *m_wallet; } + ClientModel& clientModel() const { return m_client_model; } QString getWalletName() const; QString getDisplayName() const; @@ -159,6 +161,7 @@ private: std::unique_ptr<interfaces::Handler> m_handler_show_progress; std::unique_ptr<interfaces::Handler> m_handler_watch_only_changed; std::unique_ptr<interfaces::Handler> m_handler_can_get_addrs_changed; + ClientModel& m_client_model; interfaces::Node& m_node; bool fHaveWatchOnly; |