1 // Copyright (c) 2010-present 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 <cstdint>
17 18 namespace node {
19 enum class TransactionError {
20 OK, //!< No error
21 MISSING_INPUTS,
22 ALREADY_IN_UTXO_SET,
23 MEMPOOL_REJECTED,
24 MEMPOOL_ERROR,
25 MAX_FEE_EXCEEDED,
26 MAX_BURN_EXCEEDED,
27 INVALID_PACKAGE,
28 PRIVATE_BROADCAST_FULL,
29 };
30 31 /**
32 * How to broadcast a local transaction.
33 * Used to influence `BroadcastTransaction()` and its callers.
34 */
35 enum class TxBroadcast : uint8_t {
36 /// Add the transaction to the mempool and broadcast to all peers for which tx relay is enabled.
37 MEMPOOL_AND_BROADCAST_TO_ALL,
38 /// Add the transaction to the mempool, but don't broadcast to anybody.
39 MEMPOOL_NO_BROADCAST,
40 /// Omit the mempool and directly send the transaction via a few dedicated connections to
41 /// peers on privacy networks.
42 NO_MEMPOOL_PRIVATE_BROADCAST,
43 };
44 45 } // namespace node
46 47 #endif // BITCOIN_NODE_TYPES_H
48