mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Revert "gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged"
This reverts commit 0933a37078 from
https://github.com/bitcoin/bitcoin/pull/18160 which no longer an optimization
since commit "gui: Avoid wallet tryGetBalances calls before TransactionChanged
or BlockTip notifications".
This commit is contained in:
@@ -95,18 +95,21 @@ void WalletModel::pollBalanceChanged()
|
||||
// rescan.
|
||||
interfaces::WalletBalances new_balances;
|
||||
int numBlocks = -1;
|
||||
if (!m_wallet->tryGetBalances(new_balances, numBlocks, fForceCheckBalanceChanged, cachedNumBlocks)) {
|
||||
if (!m_wallet->tryGetBalances(new_balances, numBlocks)) {
|
||||
return;
|
||||
}
|
||||
|
||||
fForceCheckBalanceChanged = false;
|
||||
if(fForceCheckBalanceChanged || numBlocks != cachedNumBlocks)
|
||||
{
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user