Bitcoin Core 31.99.0
P2P Digital Currency
Public Attributes | List of all members
node::BlockCreateOptions Struct Reference

Block template creation options. More...

#include <mining_types.h>

Collaboration diagram for node::BlockCreateOptions:
[legend]

Public Attributes

bool use_mempool {true}
 Set false to omit mempool transactions. More...
 
std::optional< CFeeRateblock_min_fee_rate {}
 Minimum fee rate for transactions to be included. More...
 
std::optional< bool > print_modified_fee {}
 Whether to log the fee rate of each transaction when it is added to the block template. More...
 
std::optional< uint64_t > block_reserved_weight {}
 The default reserved weight for the fixed-size block header, transaction count and coinbase transaction. More...
 
std::optional< uint64_t > block_max_weight {}
 Maximum block weight, defaults to -maxblockweight. More...
 
size_t coinbase_output_max_additional_sigops {DEFAULT_COINBASE_OUTPUT_MAX_ADDITIONAL_SIGOPS}
 The maximum additional sigops which the pool will add in coinbase transaction outputs. More...
 
CScript coinbase_output_script {CScript() << OP_TRUE}
 Script to put in the coinbase transaction. More...
 
bool test_block_validity {true}
 Whether to call TestBlockValidity() at the end of CreateNewBlock(). More...
 

Detailed Description

Block template creation options.

These override node defaults, but can't exceed node limits (e.g. block_reserved_weight can't exceed max block weight).

Definition at line 33 of file mining_types.h.

Member Data Documentation

◆ block_max_weight

std::optional<uint64_t> node::BlockCreateOptions::block_max_weight {}

Maximum block weight, defaults to -maxblockweight.

Must not be lower than block_reserved_weight. Setting this equal to block_reserved_weight leaves no room for non-coinbase transactions.

Definition at line 65 of file mining_types.h.

◆ block_min_fee_rate

std::optional<CFeeRate> node::BlockCreateOptions::block_min_fee_rate {}

Minimum fee rate for transactions to be included.

Providing a value overrides the -blockmintxfee startup setting.

Definition at line 42 of file mining_types.h.

◆ block_reserved_weight

std::optional<uint64_t> node::BlockCreateOptions::block_reserved_weight {}

The default reserved weight for the fixed-size block header, transaction count and coinbase transaction.

Minimum: 2000 weight units (MINIMUM_BLOCK_RESERVED_WEIGHT).

Providing a value overrides the -blockreservedweight startup setting. Cap'n Proto IPC clients currently cannot leave this field unset, so they always provide a value.

Definition at line 58 of file mining_types.h.

◆ coinbase_output_max_additional_sigops

size_t node::BlockCreateOptions::coinbase_output_max_additional_sigops {DEFAULT_COINBASE_OUTPUT_MAX_ADDITIONAL_SIGOPS}

The maximum additional sigops which the pool will add in coinbase transaction outputs.

Definition at line 70 of file mining_types.h.

◆ coinbase_output_script

CScript node::BlockCreateOptions::coinbase_output_script {CScript() << OP_TRUE}

Script to put in the coinbase transaction.

The default is an anyone-can-spend dummy.

Should only be used for tests, when the default doesn't suffice.

Note that higher level code like the getblocktemplate RPC may omit the coinbase transaction entirely. It's instead constructed by pool software using fields like coinbasevalue, coinbaseaux and default_witness_commitment. This software typically also controls the payout outputs, even for solo mining.

The size and sigops are not checked against coinbase_max_additional_weight and coinbase_output_max_additional_sigops.

Definition at line 86 of file mining_types.h.

◆ print_modified_fee

std::optional<bool> node::BlockCreateOptions::print_modified_fee {}

Whether to log the fee rate of each transaction when it is added to the block template.

Providing a value overrides the -printpriority startup setting.

Definition at line 48 of file mining_types.h.

◆ test_block_validity

bool node::BlockCreateOptions::test_block_validity {true}

Whether to call TestBlockValidity() at the end of CreateNewBlock().

Should only be used for tests / benchmarks.

Definition at line 91 of file mining_types.h.

◆ use_mempool

bool node::BlockCreateOptions::use_mempool {true}

Set false to omit mempool transactions.

Definition at line 37 of file mining_types.h.


The documentation for this struct was generated from the following file: