Bitcoin Core 31.99.0
P2P Digital Currency
types.h
Go to the documentation of this file.
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
12
13#ifndef BITCOIN_NODE_TYPES_H
14#define BITCOIN_NODE_TYPES_H
15
16#include <consensus/amount.h>
17#include <cstddef>
18#include <cstdint>
19#include <optional>
20#include <policy/policy.h>
22#include <script/script.h>
23#include <uint256.h>
24#include <util/time.h>
25#include <vector>
26
27namespace node {
28enum class TransactionError {
29 OK,
30 MISSING_INPUTS,
37};
38
43 bool use_mempool{true};
53 std::optional<size_t> block_reserved_weight{};
75};
76
82 MillisecondsDouble timeout{MillisecondsDouble::max()};
83
96};
97
103
107 bool check_pow{true};
108};
109
116 /* nVersion */
117 uint32_t version;
118 /* nSequence for the only coinbase transaction input */
119 uint32_t sequence;
140 std::optional<uint256> witness;
148 /*
149 * To be included as the last outputs in the coinbase transaction.
150 * Currently this is only the witness commitment OP_RETURN, but future
151 * softforks or a custom mining patch could add more.
152 *
153 * The dummy output that spends the full reward is excluded.
154 */
155 std::vector<CTxOut> required_outputs;
156 uint32_t lock_time;
157};
158
163enum class TxBroadcast : uint8_t {
171};
172
173} // namespace node
174
175#endif // BITCOIN_NODE_TYPES_H
static constexpr CAmount MAX_MONEY
No amount larger than this (in satoshi) is valid.
Definition: amount.h:26
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:405
Definition: messages.h:21
TxBroadcast
How to broadcast a local transaction.
Definition: types.h:163
@ MEMPOOL_AND_BROADCAST_TO_ALL
Add the transaction to the mempool and broadcast to all peers for which tx relay is enabled.
@ MEMPOOL_NO_BROADCAST
Add the transaction to the mempool, but don't broadcast to anybody.
@ NO_MEMPOOL_PRIVATE_BROADCAST
Omit the mempool and directly send the transaction via a few dedicated connections to peers on privac...
TransactionError
Definition: types.h:28
static constexpr unsigned int DEFAULT_COINBASE_OUTPUT_MAX_ADDITIONAL_SIGOPS
Default sigops cost to reserve for coinbase transaction outputs when creating block templates.
Definition: policy.h:29
@ OP_TRUE
Definition: script.h:84
@ OK
The message verification was successful.
bool check_pow
Set false to omit the proof-of-work check.
Definition: types.h:107
bool check_merkle_root
Set false to omit the merkle root check.
Definition: types.h:102
std::optional< size_t > block_reserved_weight
The default reserved weight for the fixed-size block header, transaction count and coinbase transacti...
Definition: types.h:53
CScript coinbase_output_script
Script to put in the coinbase transaction.
Definition: types.h:74
bool use_mempool
Set false to omit mempool transactions.
Definition: types.h:43
size_t coinbase_output_max_additional_sigops
The maximum additional sigops which the pool will add in coinbase transaction outputs.
Definition: types.h:58
MillisecondsDouble timeout
How long to wait before returning nullptr instead of a new template.
Definition: types.h:82
CAmount fee_threshold
The wait method will not return a new template unless it has fees at least fee_threshold sats higher ...
Definition: types.h:95
Template containing all coinbase transaction fields that are set by our miner code.
Definition: types.h:115
uint32_t sequence
Definition: types.h:119
uint32_t lock_time
Definition: types.h:156
CScript script_sig_prefix
Prefix which needs to be placed at the beginning of the scriptSig.
Definition: types.h:131
CAmount block_reward_remaining
Block subsidy plus fees, minus any non-zero required_outputs.
Definition: types.h:147
std::vector< CTxOut > required_outputs
Definition: types.h:155
std::optional< uint256 > witness
The first (and only) witness stack element of the coinbase input.
Definition: types.h:140
uint32_t version
Definition: types.h:117
std::chrono::duration< double, std::chrono::milliseconds::period > MillisecondsDouble
Definition: time.h:103