LCOV - code coverage report
Current view: top level - src/wallet - receive.h (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 10 10 100.0 %
Date: 2026-06-25 07:23:43 Functions: 2 2 100.0 %

          Line data    Source code
       1             : // Copyright (c) 2021 The Bitcoin Core developers
       2             : // Distributed under the MIT software license, see the accompanying
       3             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4             : 
       5             : #ifndef BITCOIN_WALLET_RECEIVE_H
       6             : #define BITCOIN_WALLET_RECEIVE_H
       7             : 
       8             : #include <consensus/amount.h>
       9             : #include <wallet/ismine.h>
      10             : #include <wallet/transaction.h>
      11             : #include <wallet/wallet.h>
      12             : 
      13             : namespace wallet {
      14             : isminetype InputIsMine(const CWallet& wallet, const CTxIn& txin) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
      15             : 
      16             : /** Returns whether all of the inputs match the filter */
      17             : bool AllInputsMine(const CWallet& wallet, const CTransaction& tx, const isminefilter& filter);
      18             : 
      19             : CAmount OutputGetCredit(const CWallet& wallet, const CTxOut& txout, const isminefilter& filter);
      20             : CAmount TxGetCredit(const CWallet& wallet, const CTransaction& tx, const isminefilter& filter);
      21             : 
      22             : bool ScriptIsChange(const CWallet& wallet, const CScript& script) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
      23             : bool OutputIsChange(const CWallet& wallet, const CTxOut& txout) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
      24             : CAmount OutputGetChange(const CWallet& wallet, const CTxOut& txout) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
      25             : CAmount TxGetChange(const CWallet& wallet, const CTransaction& tx);
      26             : 
      27             : CAmount CachedTxGetCredit(const CWallet& wallet, const CWalletTx& wtx, const isminefilter& filter)
      28             :     EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
      29             : //! filter decides which addresses will count towards the debit
      30             : CAmount CachedTxGetDebit(const CWallet& wallet, const CWalletTx& wtx, const isminefilter& filter);
      31             : CAmount CachedTxGetChange(const CWallet& wallet, const CWalletTx& wtx);
      32             : CAmount CachedTxGetImmatureCredit(const CWallet& wallet, const CWalletTx& wtx, const isminefilter& filter)
      33             :     EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
      34             : CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, const isminefilter& filter = ISMINE_SPENDABLE)
      35             :     EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
      36             : struct COutputEntry
      37             : {
      38             :     CTxDestination destination;
      39             :     CAmount amount;
      40             :     int vout;
      41             : };
      42             : void CachedTxGetAmounts(const CWallet& wallet, const CWalletTx& wtx,
      43             :                         std::list<COutputEntry>& listReceived,
      44             :                         std::list<COutputEntry>& listSent,
      45             :                         CAmount& nFee, const isminefilter& filter);
      46             : bool CachedTxIsFromMe(const CWallet& wallet, const CWalletTx& wtx, const isminefilter& filter);
      47             : bool CachedTxIsTrusted(const CWallet& wallet, const CWalletTx& wtx, std::set<uint256>& trusted_parents) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
      48             : bool CachedTxIsTrusted(const CWallet& wallet, const CWalletTx& wtx);
      49             : 
      50        5647 : struct Balance {
      51        5647 :     CAmount m_mine_trusted{0};           //!< Trusted, at depth=GetBalance.min_depth or more
      52        5647 :     CAmount m_mine_untrusted_pending{0}; //!< Untrusted, but in mempool (pending)
      53        5647 :     CAmount m_mine_immature{0};          //!< Immature coinbases in the main chain
      54        5647 :     CAmount m_watchonly_trusted{0};
      55        5647 :     CAmount m_watchonly_untrusted_pending{0};
      56        5647 :     CAmount m_watchonly_immature{0};
      57        5647 :     CAmount m_anonymized{0};
      58        5647 :     CAmount m_denominated_trusted{0};
      59        5647 :     CAmount m_denominated_untrusted_pending{0};
      60             : };
      61             : Balance GetBalance(const CWallet& wallet, int min_depth = 0, bool avoid_reuse = true, const bool fAddLocked = false);
      62             : 
      63             : std::map<CTxDestination, CAmount> GetAddressBalances(const CWallet& wallet);
      64             : std::set<std::set<CTxDestination>> GetAddressGroupings(const CWallet& wallet) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
      65             : } // namespace wallet
      66             : 
      67             : #endif // BITCOIN_WALLET_RECEIVE_H

Generated by: LCOV version 1.16