mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-29 21:42:32 +02:00
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
This commit is contained in:
parent
e62958dc81
commit
321335bf02
@ -120,12 +120,17 @@ void WalletModel::pollBalanceChanged()
|
|||||||
|
|
||||||
void WalletModel::checkBalanceChanged(const interfaces::WalletBalances& new_balances)
|
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;
|
m_cached_balances = new_balances;
|
||||||
Q_EMIT balanceChanged(new_balances);
|
Q_EMIT balanceChanged(new_balances);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interfaces::WalletBalances WalletModel::getCachedBalance() const
|
||||||
|
{
|
||||||
|
return m_cached_balances;
|
||||||
|
}
|
||||||
|
|
||||||
void WalletModel::updateTransaction()
|
void WalletModel::updateTransaction()
|
||||||
{
|
{
|
||||||
// Balance and number of transactions might have changed
|
// Balance and number of transactions might have changed
|
||||||
|
@ -157,6 +157,9 @@ public:
|
|||||||
|
|
||||||
uint256 getLastBlockProcessed() const;
|
uint256 getLastBlockProcessed() const;
|
||||||
|
|
||||||
|
// Retrieve the cached wallet balance
|
||||||
|
interfaces::WalletBalances getCachedBalance() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<interfaces::Wallet> m_wallet;
|
std::unique_ptr<interfaces::Wallet> m_wallet;
|
||||||
std::unique_ptr<interfaces::Handler> m_handler_unload;
|
std::unique_ptr<interfaces::Handler> m_handler_unload;
|
||||||
|
Loading…
Reference in New Issue
Block a user