MCPcopy Create free account
hub / github.com/ElementsProject/elements / getBalances

Method getBalances

src/wallet/interfaces.cpp:379–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377 return m_wallet->FillPSBT(psbtx, complete, sighash_type, sign, bip32derivs, n_signed);
378 }
379 WalletBalances getBalances() override
380 {
381 const auto bal = GetBalance(*m_wallet);
382 WalletBalances result;
383 result.balance = bal.m_mine_trusted;
384 result.unconfirmed_balance = bal.m_mine_untrusted_pending;
385 result.immature_balance = bal.m_mine_immature;
386 result.have_watch_only = haveWatchOnly();
387 if (result.have_watch_only) {
388 result.watch_only_balance = bal.m_watchonly_trusted;
389 result.unconfirmed_watch_only_balance = bal.m_watchonly_untrusted_pending;
390 result.immature_watch_only_balance = bal.m_watchonly_immature;
391 }
392 return result;
393 }
394 bool tryGetBalances(WalletBalances& balances, uint256& block_hash) override
395 {
396 TRY_LOCK(m_wallet->cs_wallet, locked_wallet);

Callers 4

sendCoinsMethod · 0.80
setModelMethod · 0.80
updateDisplayUnitMethod · 0.80
setWalletModelMethod · 0.80

Calls 1

GetBalanceFunction · 0.85

Tested by

no test coverage detected