aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/walletmodel.cpp')
-rw-r--r--src/qt/walletmodel.cpp43
1 files changed, 5 insertions, 38 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index b4733d369e..f7b1552f3e 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -34,7 +34,6 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p
cachedEncryptionStatus(Unencrypted),
cachedNumBlocks(0)
{
- fProcessingQueuedTransactions = false;
fHaveWatchOnly = wallet->HaveWatchOnly();
fForceCheckBalanceChanged = false;
@@ -164,11 +163,8 @@ void WalletModel::checkBalanceChanged()
}
}
-void WalletModel::updateTransaction(const QString &hash, int status)
+void WalletModel::updateTransaction()
{
- if(transactionTableModel)
- transactionTableModel->updateTransaction(hash, status);
-
// Balance and number of transactions might have changed
fForceCheckBalanceChanged = true;
}
@@ -455,45 +451,16 @@ static void NotifyAddressBookChanged(WalletModel *walletmodel, CWallet *wallet,
Q_ARG(int, status));
}
-// queue notifications to show a non freezing progress dialog e.g. for rescan
-static bool fQueueNotifications = false;
-static std::vector<std::pair<uint256, ChangeType> > vQueueNotifications;
static void NotifyTransactionChanged(WalletModel *walletmodel, CWallet *wallet, const uint256 &hash, ChangeType status)
{
- if (fQueueNotifications)
- {
- vQueueNotifications.push_back(make_pair(hash, status));
- return;
- }
-
- QString strHash = QString::fromStdString(hash.GetHex());
-
- qDebug() << "NotifyTransactionChanged : " + strHash + " status= " + QString::number(status);
- QMetaObject::invokeMethod(walletmodel, "updateTransaction", Qt::QueuedConnection,
- Q_ARG(QString, strHash),
- Q_ARG(int, status));
+ Q_UNUSED(wallet);
+ Q_UNUSED(hash);
+ Q_UNUSED(status);
+ QMetaObject::invokeMethod(walletmodel, "updateTransaction", Qt::QueuedConnection);
}
static void ShowProgress(WalletModel *walletmodel, const std::string &title, int nProgress)
{
- if (nProgress == 0)
- fQueueNotifications = true;
-
- if (nProgress == 100)
- {
- fQueueNotifications = false;
- if (vQueueNotifications.size() > 10) // prevent balloon spam, show maximum 10 balloons
- QMetaObject::invokeMethod(walletmodel, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, true));
- for (unsigned int i = 0; i < vQueueNotifications.size(); ++i)
- {
- if (vQueueNotifications.size() - i <= 10)
- QMetaObject::invokeMethod(walletmodel, "setProcessingQueuedTransactions", Qt::QueuedConnection, Q_ARG(bool, false));
-
- NotifyTransactionChanged(walletmodel, NULL, vQueueNotifications[i].first, vQueueNotifications[i].second);
- }
- std::vector<std::pair<uint256, ChangeType> >().swap(vQueueNotifications); // clear
- }
-
// emits signal "showProgress"
QMetaObject::invokeMethod(walletmodel, "showProgress", Qt::QueuedConnection,
Q_ARG(QString, QString::fromStdString(title)),