LCOV - code coverage report
Current view: top level - src/wallet - types.h (source / functions) Coverage Total Hit
Test: total_coverage.info Lines: 100.0 % 3 3
Test Date: 2026-02-25 05:45:00 Functions: 100.0 % 1 1
Branches: 39.3 % 28 11

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) 2009-2010 Satoshi Nakamoto
       2                 :             : // Copyright (c) 2009-present The Bitcoin Core developers
       3                 :             : // Distributed under the MIT software license, see the accompanying
       4                 :             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       5                 :             : 
       6                 :             : //! @file wallet/types.h is a home for public enum and struct type definitions
       7                 :             : //! that are used by internally by wallet code, but also used externally by node
       8                 :             : //! or GUI code.
       9                 :             : //!
      10                 :             : //! This file is intended to define only simple types that do not have external
      11                 :             : //! dependencies. More complicated public wallet types like CCoinControl should
      12                 :             : //! be defined in dedicated header files.
      13                 :             : 
      14                 :             : #ifndef BITCOIN_WALLET_TYPES_H
      15                 :             : #define BITCOIN_WALLET_TYPES_H
      16                 :             : 
      17                 :             : #include <policy/fees/block_policy_estimator.h>
      18                 :             : 
      19                 :             : namespace wallet {
      20                 :             : /**
      21                 :             :  * Address purpose field that has been been stored with wallet sending and
      22                 :             :  * receiving addresses since BIP70 payment protocol support was added in
      23                 :             :  * https://github.com/bitcoin/bitcoin/pull/2539. This field is not currently
      24                 :             :  * used for any logic inside the wallet, but it is still shown in RPC and GUI
      25                 :             :  * interfaces and saved for new addresses. It is basically redundant with an
      26                 :             :  * address's IsMine() result.
      27                 :             :  */
      28                 :             : enum class AddressPurpose {
      29                 :             :     RECEIVE,
      30                 :             :     SEND,
      31                 :             :     REFUND, //!< Never set in current code may be present in older wallet databases
      32                 :             : };
      33                 :             : 
      34   [ +  +  -  +  :       13599 : struct CreatedTransactionResult
           +  - ][ -  -  
             -  +  +  - ]
           [ -  -  +  -  
          -  -  +  -  +  
             -  +  -  -  
                      - ]
      35                 :             : {
      36                 :             :     CTransactionRef tx;
      37                 :             :     CAmount fee;
      38                 :             :     FeeCalculation fee_calc;
      39                 :             :     std::optional<unsigned int> change_pos;
      40                 :             : 
      41                 :        3510 :     CreatedTransactionResult(CTransactionRef _tx, CAmount _fee, std::optional<unsigned int> _change_pos, const FeeCalculation& _fee_calc)
      42         [ +  - ]:        3510 :             : tx(_tx), fee(_fee), fee_calc(_fee_calc), change_pos(_change_pos) {}
      43                 :             : };
      44                 :             : 
      45                 :             : } // namespace wallet
      46                 :             : 
      47                 :             : #endif // BITCOIN_WALLET_TYPES_H
        

Generated by: LCOV version 2.0-1