mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-10 14:48:46 +02: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:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <interfaces/chain.h>
|
||||
#include <interfaces/node.h>
|
||||
#include <qt/clientmodel.h>
|
||||
#include <qt/editaddressdialog.h>
|
||||
#include <qt/optionsmodel.h>
|
||||
#include <qt/platformstyle.h>
|
||||
@@ -101,8 +102,9 @@ void TestAddAddressesToSendBook(interfaces::Node& node)
|
||||
// Initialize relevant QT models.
|
||||
std::unique_ptr<const PlatformStyle> platformStyle(PlatformStyle::instantiate("other"));
|
||||
OptionsModel optionsModel(node);
|
||||
ClientModel clientModel(node, &optionsModel);
|
||||
AddWallet(wallet);
|
||||
WalletModel walletModel(interfaces::MakeWallet(wallet), node, platformStyle.get(), &optionsModel);
|
||||
WalletModel walletModel(interfaces::MakeWallet(wallet), clientModel, platformStyle.get());
|
||||
RemoveWallet(wallet);
|
||||
EditAddressDialog editAddressDialog(EditAddressDialog::NewSendingAddress);
|
||||
editAddressDialog.setModel(walletModel.getAddressTableModel());
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <interfaces/chain.h>
|
||||
#include <interfaces/node.h>
|
||||
#include <qt/bitcoinamountfield.h>
|
||||
#include <qt/clientmodel.h>
|
||||
#include <qt/optionsmodel.h>
|
||||
#include <qt/platformstyle.h>
|
||||
#include <qt/qvalidatedlineedit.h>
|
||||
@@ -165,8 +166,9 @@ void TestGUI(interfaces::Node& node)
|
||||
SendCoinsDialog sendCoinsDialog(platformStyle.get());
|
||||
TransactionView transactionView(platformStyle.get());
|
||||
OptionsModel optionsModel(node);
|
||||
ClientModel clientModel(node, &optionsModel);
|
||||
AddWallet(wallet);
|
||||
WalletModel walletModel(interfaces::MakeWallet(wallet), node, platformStyle.get(), &optionsModel);
|
||||
WalletModel walletModel(interfaces::MakeWallet(wallet), clientModel, platformStyle.get());
|
||||
RemoveWallet(wallet);
|
||||
sendCoinsDialog.setModel(&walletModel);
|
||||
transactionView.setModel(&walletModel);
|
||||
|
||||
Reference in New Issue
Block a user