Bitcoin Core 30.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};
70};
71
77 MillisecondsDouble timeout{MillisecondsDouble::max()};
78
91};
92
98
102 bool check_pow{true};
103};
104
111 /* nVersion */
112 uint32_t version;
113 /* nSequence for the only coinbase transaction input */
114 uint32_t sequence;
133 std::optional<uint256> witness;
141 /*
142 * To be included as the last outputs in the coinbase transaction.
143 * Currently this is only the witness commitment OP_RETURN, but future
144 * softforks or a custom mining patch could add more.
145 *
146 * The dummy output that spends the full reward is excluded.
147 */
148 std::vector<CTxOut> required_outputs;
149 uint32_t lock_time;
150};
151
156enum class TxBroadcast : uint8_t {
164};
165
166} // namespace node
167
168#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:156
@ 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_BLOCK_RESERVED_WEIGHT
Default for -blockreservedweight.
Definition: policy.h:26
@ 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:102
bool check_merkle_root
Set false to omit the merkle root check.
Definition: types.h:97
size_t block_reserved_weight
The default reserved weight for the fixed-size block header, transaction count and coinbase transacti...
Definition: types.h:48
CScript coinbase_output_script
Script to put in the coinbase transaction.
Definition: types.h:69
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:53
MillisecondsDouble timeout
How long to wait before returning nullptr instead of a new template.
Definition: types.h:77
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:90
Template containing all coinbase transaction fields that are set by our miner code.
Definition: types.h:110
uint32_t sequence
Definition: types.h:114
uint32_t lock_time
Definition: types.h:149
CScript script_sig_prefix
Prefix which needs to be placed at the beginning of the scriptSig.
Definition: types.h:124
CAmount block_reward_remaining
Block subsidy plus fees, minus any non-zero required_outputs.
Definition: types.h:140
std::vector< CTxOut > required_outputs
Definition: types.h:148
std::optional< uint256 > witness
The first (and only) witness stack element of the coinbase input.
Definition: types.h:133
uint32_t version
Definition: types.h:112
std::chrono::duration< double, std::chrono::milliseconds::period > MillisecondsDouble
Definition: time.h:88