Bitcoin Core 31.99.0
P2P Digital Currency
mining_types.h
Go to the documentation of this file.
1// Copyright (c) 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
10
11#ifndef BITCOIN_NODE_MINING_TYPES_H
12#define BITCOIN_NODE_MINING_TYPES_H
13
14#include <consensus/amount.h>
15#include <policy/feerate.h>
16#include <policy/policy.h>
18#include <script/script.h>
19#include <uint256.h>
20#include <util/time.h>
21
22#include <cstddef>
23#include <cstdint>
24#include <optional>
25#include <vector>
26
27namespace node {
28
37 bool use_mempool{true};
42 std::optional<CFeeRate> block_min_fee_rate{};
48 std::optional<bool> print_modified_fee{};
58 std::optional<uint64_t> block_reserved_weight{};
65 std::optional<uint64_t> block_max_weight{};
92};
93
99 MillisecondsDouble timeout{MillisecondsDouble::max()};
100
113};
114
120
124 bool check_pow{true};
125};
126
133 /* nVersion */
134 uint32_t version;
135 /* nSequence for the only coinbase transaction input */
136 uint32_t sequence;
157 std::optional<uint256> witness;
165 /*
166 * To be included as the last outputs in the coinbase transaction.
167 * Currently this is only the witness commitment OP_RETURN, but future
168 * softforks or a custom mining patch could add more.
169 *
170 * The dummy output that spends the full reward is excluded.
171 */
172 std::vector<CTxOut> required_outputs;
173 uint32_t lock_time;
174};
175
176} // namespace node
177
178#endif // BITCOIN_NODE_MINING_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
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
bool check_pow
Set false to omit the proof-of-work check.
Definition: mining_types.h:124
bool check_merkle_root
Set false to omit the merkle root check.
Definition: mining_types.h:119
Block template creation options.
Definition: mining_types.h:33
std::optional< bool > print_modified_fee
Whether to log the fee rate of each transaction when it is added to the block template.
Definition: mining_types.h:48
std::optional< CFeeRate > block_min_fee_rate
Minimum fee rate for transactions to be included.
Definition: mining_types.h:42
CScript coinbase_output_script
Script to put in the coinbase transaction.
Definition: mining_types.h:86
bool test_block_validity
Whether to call TestBlockValidity() at the end of CreateNewBlock().
Definition: mining_types.h:91
bool use_mempool
Set false to omit mempool transactions.
Definition: mining_types.h:37
std::optional< uint64_t > block_max_weight
Maximum block weight, defaults to -maxblockweight.
Definition: mining_types.h:65
size_t coinbase_output_max_additional_sigops
The maximum additional sigops which the pool will add in coinbase transaction outputs.
Definition: mining_types.h:70
std::optional< uint64_t > block_reserved_weight
The default reserved weight for the fixed-size block header, transaction count and coinbase transacti...
Definition: mining_types.h:58
MillisecondsDouble timeout
How long to wait before returning nullptr instead of a new template.
Definition: mining_types.h:99
CAmount fee_threshold
The wait method will not return a new template unless it has fees at least fee_threshold sats higher ...
Definition: mining_types.h:112
Template containing all coinbase transaction fields that are set by our miner code.
Definition: mining_types.h:132
uint32_t lock_time
Definition: mining_types.h:173
CScript script_sig_prefix
Prefix which needs to be placed at the beginning of the scriptSig.
Definition: mining_types.h:148
CAmount block_reward_remaining
Block subsidy plus fees, minus any non-zero required_outputs.
Definition: mining_types.h:164
std::vector< CTxOut > required_outputs
Definition: mining_types.h:172
std::optional< uint256 > witness
The first (and only) witness stack element of the coinbase input.
Definition: mining_types.h:157
std::chrono::duration< double, std::chrono::milliseconds::period > MillisecondsDouble
Definition: time.h:103