Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/wallet.cpp
Show First 20 Lines • Show All 325 Lines • ▼ Show 20 Lines | public: | ||||
if (result.have_watch_only) { | if (result.have_watch_only) { | ||||
result.watch_only_balance = bal.m_watchonly_trusted; | result.watch_only_balance = bal.m_watchonly_trusted; | ||||
result.unconfirmed_watch_only_balance = | result.unconfirmed_watch_only_balance = | ||||
bal.m_watchonly_untrusted_pending; | bal.m_watchonly_untrusted_pending; | ||||
result.immature_watch_only_balance = bal.m_watchonly_immature; | result.immature_watch_only_balance = bal.m_watchonly_immature; | ||||
} | } | ||||
return result; | return result; | ||||
} | } | ||||
bool tryGetBalances(WalletBalances &balances, | bool tryGetBalances(WalletBalances &balances, int &num_blocks, | ||||
int &num_blocks) override { | bool force, int cached_num_blocks) override { | ||||
TRY_LOCK(m_wallet->cs_wallet, locked_wallet); | TRY_LOCK(m_wallet->cs_wallet, locked_wallet); | ||||
if (!locked_wallet) { | if (!locked_wallet) { | ||||
return false; | return false; | ||||
} | } | ||||
num_blocks = m_wallet->GetLastBlockHeight(); | num_blocks = m_wallet->GetLastBlockHeight(); | ||||
if (!force && num_blocks == cached_num_blocks) { | |||||
return false; | |||||
} | |||||
balances = getBalances(); | balances = getBalances(); | ||||
return true; | return true; | ||||
} | } | ||||
Amount getBalance() override { | Amount getBalance() override { | ||||
return m_wallet->GetBalance().m_mine_trusted; | return m_wallet->GetBalance().m_mine_trusted; | ||||
} | } | ||||
Amount getAvailableBalance(const CCoinControl &coin_control) override { | Amount getAvailableBalance(const CCoinControl &coin_control) override { | ||||
return m_wallet->GetAvailableBalance(&coin_control); | return m_wallet->GetAvailableBalance(&coin_control); | ||||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |