From 023e63df78b847812040bf6958c97476606dfbfd Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 28 Oct 2014 19:52:21 +0100 Subject: qt: Move transaction notification to transaction table model Move transaction new/update notification to TransactionTableModel. This moves the concerns to where they're actually handled. No need to bounce this through wallet model. - Do wallet transaction preprocessing on signal handler side; avoids locking cs_main/cs_wallet on notification in GUI thread (except for new transactions) --- src/qt/walletview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/qt/walletview.cpp') diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index eff50593bd..3b8fdd7e5f 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -137,10 +137,12 @@ void WalletView::setWalletModel(WalletModel *walletModel) void WalletView::processNewTransaction(const QModelIndex& parent, int start, int /*end*/) { // Prevent balloon-spam when initial block download is in progress - if (!walletModel || walletModel->processingQueuedTransactions() || !clientModel || clientModel->inInitialBlockDownload()) + if (!walletModel || !clientModel || clientModel->inInitialBlockDownload()) return; TransactionTableModel *ttm = walletModel->getTransactionTableModel(); + if (!ttm || ttm->processingQueuedTransactions()) + return; QString date = ttm->index(start, TransactionTableModel::Date, parent).data().toString(); qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent).data(Qt::EditRole).toULongLong(); -- cgit v1.2.3