Skip to content

Commit

Permalink
qt: Early subscribe core signals in transaction table model
Browse files Browse the repository at this point in the history
  • Loading branch information
promag committed Apr 28, 2021
1 parent c6cbdf1 commit 57785fb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/qt/transactiontablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class TransactionTablePriv
}
}
m_loaded = true;
DispatchNotifications();
}

/* Update our model of the wallet incrementally, to synchronize our model of the wallet
Expand Down Expand Up @@ -252,12 +253,12 @@ TransactionTableModel::TransactionTableModel(const PlatformStyle *_platformStyle
fProcessingQueuedTransactions(false),
platformStyle(_platformStyle)
{
subscribeToCoreSignals();

columns << QString() << QString() << tr("Date") << tr("Type") << tr("Label") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());
priv->refreshWallet(walletModel->wallet());

connect(walletModel->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &TransactionTableModel::updateDisplayUnit);

subscribeToCoreSignals();
}

TransactionTableModel::~TransactionTableModel()
Expand Down Expand Up @@ -722,7 +723,7 @@ void TransactionTablePriv::NotifyTransactionChanged(const uint256 &hash, ChangeT

TransactionNotification notification(hash, status, showTransaction);

if (m_loading)
if (!m_loaded || m_loading)
{
vQueueNotifications.push_back(notification);
return;
Expand All @@ -732,7 +733,7 @@ void TransactionTablePriv::NotifyTransactionChanged(const uint256 &hash, ChangeT

void TransactionTablePriv::DispatchNotifications()
{
if (m_loading) return;
if (!m_loaded || m_loading) return;

{
if (vQueueNotifications.size() > 10) { // prevent balloon spam, show maximum 10 balloons
Expand Down

0 comments on commit 57785fb

Please sign in to comment.