Bitcoin Core 32.1.0
P2P Digital Currency
Loading...
Searching...
No Matches
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
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
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:406
CScript()=default
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:85
bool check_pow
Set false to omit the proof-of-work check.
bool check_merkle_root
Set false to omit the merkle root check.
Block template creation options.
std::optional< bool > print_modified_fee
Whether to log the fee rate of each transaction when it is added to the block template.
std::optional< CFeeRate > block_min_fee_rate
Minimum fee rate for transactions to be included.
CScript coinbase_output_script
Script to put in the coinbase transaction.
bool test_block_validity
Whether to call TestBlockValidity() at the end of CreateNewBlock().
bool use_mempool
Set false to omit mempool transactions.
std::optional< uint64_t > block_max_weight
Maximum block weight, defaults to -maxblockweight.
size_t coinbase_output_max_additional_sigops
The maximum additional sigops which the pool will add in coinbase transaction outputs.
std::optional< uint64_t > block_reserved_weight
The default reserved weight for the fixed-size block header, transaction count and coinbase transacti...
MillisecondsDouble timeout
How long to wait before returning nullptr instead of a new template.
CAmount fee_threshold
The wait method will not return a new template unless it has fees at least fee_threshold sats higher ...
Template containing all coinbase transaction fields that are set by our miner code.
CScript script_sig_prefix
Prefix which needs to be placed at the beginning of the scriptSig.
CAmount block_reward_remaining
Block subsidy plus fees, minus any non-zero required_outputs.
std::vector< CTxOut > required_outputs
std::optional< uint256 > witness
The first (and only) witness stack element of the coinbase input.
std::chrono::duration< double, std::chrono::milliseconds::period > MillisecondsDouble
Definition time.h:103