Each 250ms the slot WalletModel::pollBalanceChanged
is called which, at worst case, calls Wallet::GetBalance
. This is a waste of resources since most of the time there aren’t new transactions or new blocks. Fix this by early checking if cache is dirty or not.
The actual balance computation can still hang the GUI thread but that is tracked in #16874 and should be fixed with a solution similar to #17135.