diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2022-05-09 11:24:20 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2022-08-12 13:05:57 -0300 |
commit | 321335bf0292034d79afa6c44f7f072942b6cc3c (patch) | |
tree | 5ce6ddabc9100410cf4cdd5d9a1723dafc9b6ccb /src/qt/walletmodel.cpp | |
parent | e62958dc81d215a1c56318d0914dfd9a33d45973 (diff) |
GUI: add getter for WalletModel::m_cached_balances field
No need to guard it as it is/will only be accessed from the main thread for now
Diffstat (limited to 'src/qt/walletmodel.cpp')
-rw-r--r-- | src/qt/walletmodel.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 5ee32e79d5..2adf1a11f1 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -120,12 +120,17 @@ void WalletModel::pollBalanceChanged() void WalletModel::checkBalanceChanged(const interfaces::WalletBalances& new_balances) { - if(new_balances.balanceChanged(m_cached_balances)) { + if (new_balances.balanceChanged(m_cached_balances)) { m_cached_balances = new_balances; Q_EMIT balanceChanged(new_balances); } } +interfaces::WalletBalances WalletModel::getCachedBalance() const +{ + return m_cached_balances; +} + void WalletModel::updateTransaction() { // Balance and number of transactions might have changed |