aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletview.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-10-28 19:52:21 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-10-28 21:20:55 +0100
commit023e63df78b847812040bf6958c97476606dfbfd (patch)
tree047396bfc6c1490db1a3bcfc95e8f4db03c26780 /src/qt/walletview.cpp
parentcd9114e5136ecc1f60baa43fffeeb632782f2353 (diff)
downloadbitcoin-023e63df78b847812040bf6958c97476606dfbfd.tar.xz
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)
Diffstat (limited to 'src/qt/walletview.cpp')
-rw-r--r--src/qt/walletview.cpp4
1 files changed, 3 insertions, 1 deletions
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();