gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged

This commit is contained in:
João Barbosa committed 2020-02-16 11:38:49 +00:00
1 parent 2a2631fb0d
commit 0933a37078
3 files changed
+15 -14

No files matched your search

+7 -10
View File
@@ -78,21 +78,18 @@ void WalletModel::pollBalanceChanged()
// rescan.
interfaces::WalletBalances new_balances;
int numBlocks = -1;
if (!m_wallet->tryGetBalances(new_balances, numBlocks)) {
if (!m_wallet->tryGetBalances(new_balances, numBlocks, fForceCheckBalanceChanged, cachedNumBlocks)) {
return;
}
if(fForceCheckBalanceChanged || numBlocks != cachedNumBlocks)
{
fForceCheckBalanceChanged = false;
fForceCheckBalanceChanged = false;
// Balance and number of transactions might have changed
cachedNumBlocks = numBlocks;
// Balance and number of transactions might have changed
cachedNumBlocks = numBlocks;
checkBalanceChanged(new_balances);
if(transactionTableModel)
transactionTableModel->updateConfirmations();
}
checkBalanceChanged(new_balances);
if(transactionTableModel)
transactionTableModel->updateConfirmations();
}
void WalletModel::checkBalanceChanged(const interfaces::WalletBalances& new_balances)