LCOV - code coverage report
Current view: top level - src/node - types.h Coverage Total Hit
Test: total_coverage.info Lines: 100.0 % 1 1
Test Date: 2025-01-19 05:08:01 Functions: - 0 0
Branches: 50.0 % 6 3

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) 2010-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                 :             : //! @file node/types.h is a home for public enum and struct type definitions
       6                 :             : //! that are used internally by node code, but also used externally by wallet,
       7                 :             : //! mining or GUI code.
       8                 :             : //!
       9                 :             : //! This file is intended to define only simple types that do not have external
      10                 :             : //! dependencies. More complicated types should be defined in dedicated header
      11                 :             : //! files.
      12                 :             : 
      13                 :             : #ifndef BITCOIN_NODE_TYPES_H
      14                 :             : #define BITCOIN_NODE_TYPES_H
      15                 :             : 
      16                 :             : #include <cstddef>
      17                 :             : #include <script/script.h>
      18                 :             : 
      19                 :             : namespace node {
      20                 :             : enum class TransactionError {
      21                 :             :     OK, //!< No error
      22                 :             :     MISSING_INPUTS,
      23                 :             :     ALREADY_IN_UTXO_SET,
      24                 :             :     MEMPOOL_REJECTED,
      25                 :             :     MEMPOOL_ERROR,
      26                 :             :     MAX_FEE_EXCEEDED,
      27                 :             :     MAX_BURN_EXCEEDED,
      28                 :             :     INVALID_PACKAGE,
      29                 :             : };
      30                 :             : 
      31         [ +  - ]:      166702 : struct BlockCreateOptions {
           [ +  -  +  - ]
      32                 :             :     /**
      33                 :             :      * Set false to omit mempool transactions
      34                 :             :      */
      35                 :             :     bool use_mempool{true};
      36                 :             :     /**
      37                 :             :      * The maximum additional weight which the pool will add to the coinbase
      38                 :             :      * scriptSig, witness and outputs. This must include any additional
      39                 :             :      * weight needed for larger CompactSize encoded lengths.
      40                 :             :      */
      41                 :             :     size_t coinbase_max_additional_weight{4000};
      42                 :             :     /**
      43                 :             :      * The maximum additional sigops which the pool will add in coinbase
      44                 :             :      * transaction outputs.
      45                 :             :      */
      46                 :             :     size_t coinbase_output_max_additional_sigops{400};
      47                 :             :     /**
      48                 :             :      * Script to put in the coinbase transaction. The default is an
      49                 :             :      * anyone-can-spend dummy.
      50                 :             :      *
      51                 :             :      * Should only be used for tests, when the default doesn't suffice.
      52                 :             :      *
      53                 :             :      * Note that higher level code like the getblocktemplate RPC may omit the
      54                 :             :      * coinbase transaction entirely. It's instead constructed by pool software
      55                 :             :      * using fields like coinbasevalue, coinbaseaux and default_witness_commitment.
      56                 :             :      * This software typically also controls the payout outputs, even for solo
      57                 :             :      * mining.
      58                 :             :      *
      59                 :             :      * The size and sigops are not checked against
      60                 :             :      * coinbase_max_additional_weight and coinbase_output_max_additional_sigops.
      61                 :             :      */
      62                 :             :     CScript coinbase_output_script{CScript() << OP_TRUE};
      63                 :             : };
      64                 :             : } // namespace node
      65                 :             : 
      66                 :             : #endif // BITCOIN_NODE_TYPES_H
        

Generated by: LCOV version 2.0-1