Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
node
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
>
21
#include <
primitives/transaction.h
>
22
#include <
script/script.h
>
23
#include <
uint256.h
>
24
#include <util/time.h>
25
#include <vector>
26
27
namespace
node
{
28
enum class
TransactionError
{
29
OK
,
30
MISSING_INPUTS
,
31
ALREADY_IN_UTXO_SET
,
32
MEMPOOL_REJECTED
,
33
MEMPOOL_ERROR
,
34
MAX_FEE_EXCEEDED
,
35
MAX_BURN_EXCEEDED
,
36
INVALID_PACKAGE
,
37
};
38
39
struct
BlockCreateOptions
{
43
bool
use_mempool
{
true
};
53
std::optional<size_t>
block_reserved_weight
{};
58
size_t
coinbase_output_max_additional_sigops
{
DEFAULT_COINBASE_OUTPUT_MAX_ADDITIONAL_SIGOPS
};
74
CScript
coinbase_output_script
{
CScript
() <<
OP_TRUE
};
78
bool
include_dummy_extranonce
{
false
};
79
};
80
81
struct
BlockWaitOptions
{
86
MillisecondsDouble
timeout
{MillisecondsDouble::max()};
87
99
CAmount
fee_threshold
{
MAX_MONEY
};
100
};
101
102
struct
BlockCheckOptions
{
106
bool
check_merkle_root
{
true
};
107
111
bool
check_pow
{
true
};
112
};
113
119
struct
CoinbaseTx
{
120
/* nVersion */
121
uint32_t
version
;
122
/* nSequence for the only coinbase transaction input */
123
uint32_t
sequence
;
133
CScript
script_sig_prefix
;
142
std::optional<uint256>
witness
;
149
CAmount
block_reward_remaining
;
150
/*
151
* To be included as the last outputs in the coinbase transaction.
152
* Currently this is only the witness commitment OP_RETURN, but future
153
* softforks or a custom mining patch could add more.
154
*
155
* The dummy output that spends the full reward is excluded.
156
*/
157
std::vector<CTxOut>
required_outputs
;
158
uint32_t
lock_time
;
159
};
160
165
enum class
TxBroadcast
: uint8_t {
167
MEMPOOL_AND_BROADCAST_TO_ALL
,
169
MEMPOOL_NO_BROADCAST
,
172
NO_MEMPOOL_PRIVATE_BROADCAST
,
173
};
174
175
}
// namespace node
176
177
#endif
// BITCOIN_NODE_TYPES_H
amount.h
MAX_MONEY
static constexpr CAmount MAX_MONEY
No amount larger than this (in satoshi) is valid.
Definition
amount.h:26
CAmount
int64_t CAmount
Amount in satoshis (Can be negative).
Definition
amount.h:12
CScript
Serialized script, used inside transaction inputs and outputs.
Definition
script.h:405
node
Definition
messages.h:21
node::TxBroadcast
TxBroadcast
How to broadcast a local transaction.
Definition
types.h:165
node::TxBroadcast::MEMPOOL_AND_BROADCAST_TO_ALL
@ MEMPOOL_AND_BROADCAST_TO_ALL
Add the transaction to the mempool and broadcast to all peers for which tx relay is enabled.
Definition
types.h:167
node::TxBroadcast::MEMPOOL_NO_BROADCAST
@ MEMPOOL_NO_BROADCAST
Add the transaction to the mempool, but don't broadcast to anybody.
Definition
types.h:169
node::TxBroadcast::NO_MEMPOOL_PRIVATE_BROADCAST
@ NO_MEMPOOL_PRIVATE_BROADCAST
Omit the mempool and directly send the transaction via a few dedicated connections to peers on privac...
Definition
types.h:172
node::TransactionError
TransactionError
Definition
types.h:28
node::TransactionError::MISSING_INPUTS
@ MISSING_INPUTS
Definition
types.h:30
node::TransactionError::MEMPOOL_REJECTED
@ MEMPOOL_REJECTED
Definition
types.h:32
node::TransactionError::MAX_FEE_EXCEEDED
@ MAX_FEE_EXCEEDED
Definition
types.h:34
node::TransactionError::MAX_BURN_EXCEEDED
@ MAX_BURN_EXCEEDED
Definition
types.h:35
node::TransactionError::MEMPOOL_ERROR
@ MEMPOOL_ERROR
Definition
types.h:33
node::TransactionError::ALREADY_IN_UTXO_SET
@ ALREADY_IN_UTXO_SET
Definition
types.h:31
node::TransactionError::INVALID_PACKAGE
@ INVALID_PACKAGE
Definition
types.h:36
node::TransactionError::OK
@ OK
No error.
Definition
types.h:29
policy.h
DEFAULT_COINBASE_OUTPUT_MAX_ADDITIONAL_SIGOPS
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:28
transaction.h
script.h
OP_TRUE
@ OP_TRUE
Definition
script.h:84
node::BlockCheckOptions
Definition
types.h:102
node::BlockCheckOptions::check_pow
bool check_pow
Set false to omit the proof-of-work check.
Definition
types.h:111
node::BlockCheckOptions::check_merkle_root
bool check_merkle_root
Set false to omit the merkle root check.
Definition
types.h:106
node::BlockCreateOptions
Definition
types.h:39
node::BlockCreateOptions::include_dummy_extranonce
bool include_dummy_extranonce
Whether to include an OP_0 as a dummy extraNonce in the template's coinbase.
Definition
types.h:78
node::BlockCreateOptions::block_reserved_weight
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
node::BlockCreateOptions::coinbase_output_script
CScript coinbase_output_script
Script to put in the coinbase transaction.
Definition
types.h:74
node::BlockCreateOptions::use_mempool
bool use_mempool
Set false to omit mempool transactions.
Definition
types.h:43
node::BlockCreateOptions::coinbase_output_max_additional_sigops
size_t coinbase_output_max_additional_sigops
The maximum additional sigops which the pool will add in coinbase transaction outputs.
Definition
types.h:58
node::BlockWaitOptions
Definition
types.h:81
node::BlockWaitOptions::timeout
MillisecondsDouble timeout
How long to wait before returning nullptr instead of a new template.
Definition
types.h:86
node::BlockWaitOptions::fee_threshold
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:99
node::CoinbaseTx
Template containing all coinbase transaction fields that are set by our miner code.
Definition
types.h:119
node::CoinbaseTx::sequence
uint32_t sequence
Definition
types.h:123
node::CoinbaseTx::lock_time
uint32_t lock_time
Definition
types.h:158
node::CoinbaseTx::script_sig_prefix
CScript script_sig_prefix
Prefix which needs to be placed at the beginning of the scriptSig.
Definition
types.h:133
node::CoinbaseTx::block_reward_remaining
CAmount block_reward_remaining
Block subsidy plus fees, minus any non-zero required_outputs.
Definition
types.h:149
node::CoinbaseTx::required_outputs
std::vector< CTxOut > required_outputs
Definition
types.h:157
node::CoinbaseTx::witness
std::optional< uint256 > witness
The first (and only) witness stack element of the coinbase input.
Definition
types.h:142
node::CoinbaseTx::version
uint32_t version
Definition
types.h:121
uint256.h
MillisecondsDouble
std::chrono::duration< double, std::chrono::milliseconds::period > MillisecondsDouble
Definition
time.h:94
Generated on
for Bitcoin Core by
1.17.0