diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2020-04-02 07:55:14 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2020-05-01 06:59:09 -0400 |
commit | d3a56be77a9d112cde4baef4314882170b9f228f (patch) | |
tree | be390f6e199b46fcabd7dcee9ce08ac8f04fa28d /src/interfaces | |
parent | bf0a510981ddc28c754881ca21c50ab18e5f2b59 (diff) |
Revert "gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged"
This reverts commit 0933a37078e1ce3a3d70983c3e7f4b3ac6c3fa37 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".
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/wallet.cpp | 3 | ||||
-rw-r--r-- | src/interfaces/wallet.h | 7 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 752448aac7..3521ca8e38 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -351,14 +351,13 @@ public: } return result; } - bool tryGetBalances(WalletBalances& balances, int& num_blocks, bool force, int cached_num_blocks) override + bool tryGetBalances(WalletBalances& balances, int& num_blocks) override { TRY_LOCK(m_wallet->cs_wallet, locked_wallet); if (!locked_wallet) { return false; } num_blocks = m_wallet->GetLastBlockHeight(); - if (!force && num_blocks == cached_num_blocks) return false; balances = getBalances(); return true; } diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index e5e3b80663..0a437e53b9 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -201,11 +201,8 @@ public: //! Get balances. virtual WalletBalances getBalances() = 0; - //! Get balances if possible without waiting for chain and wallet locks. - virtual bool tryGetBalances(WalletBalances& balances, - int& num_blocks, - bool force, - int cached_num_blocks) = 0; + //! Get balances if possible without blocking. + virtual bool tryGetBalances(WalletBalances& balances, int& num_blocks) = 0; //! Get balance. virtual CAmount getBalance() = 0; |