Page MenuHomePhabricator

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

Authored by PiRK on Wed, Jan 13, 10:38.

Details

Summary

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.

This is a backport of Core PR18160

See D7938 (Remove locked_chain from CWallet) for why the src/interfaces/wallet.cpp diff looks different

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.