LCOV - code coverage report
Current view: top level - src/interfaces - wallet.cpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 0 17 0.0 %
Date: 2025-02-23 09:33:43 Functions: 0 1 0.0 %

          Line data    Source code
       1             : // Copyright (c) 2018-2020 The Bitcoin Core developers
       2             : // Copyright (c) 2020-2021 The PIVX Core developers
       3             : // Distributed under the MIT software license, see the accompanying
       4             : // file COPYING or https://www.opensource.org/licenses/mit-license.php.
       5             : 
       6             : #include "interfaces/wallet.h"
       7             : #include "wallet.h"
       8             : 
       9             : namespace interfaces {
      10             : 
      11           0 :     WalletBalances Wallet::getBalances() {
      12           0 :         WalletBalances result;
      13           0 :         CWallet::Balance balance = m_wallet.GetBalance();
      14           0 :         result.balance = balance.m_mine_trusted + balance.m_mine_trusted_shield;
      15           0 :         result.unconfirmed_balance = balance.m_mine_untrusted_pending;
      16           0 :         result.immature_balance = balance.m_mine_immature;
      17           0 :         result.have_watch_only = m_wallet.HaveWatchOnly();
      18           0 :         if (result.have_watch_only) {
      19           0 :             result.watch_only_balance = m_wallet.GetWatchOnlyBalance();
      20           0 :             result.unconfirmed_watch_only_balance = m_wallet.GetUnconfirmedWatchOnlyBalance();
      21           0 :             result.immature_watch_only_balance = m_wallet.GetImmatureWatchOnlyBalance();
      22             :         }
      23           0 :         result.delegate_balance = balance.m_mine_cs_delegated_trusted;
      24           0 :         if (result.have_coldstaking) { // At the moment, the GUI is not using the cold staked balance.
      25           0 :             result.coldstaked_balance = m_wallet.GetColdStakingBalance();
      26             :         }
      27           0 :         result.shielded_balance = balance.m_mine_trusted_shield;
      28           0 :         result.unconfirmed_shielded_balance = balance.m_mine_untrusted_shielded_balance;
      29           0 :         return result;
      30             :     }
      31             : 
      32             : } // namespace interfaces

Generated by: LCOV version 1.14