Bitcoin Core 29.99.0
P2P Digital Currency
Public Member Functions | List of all members
interfaces::BlockTemplate Class Referenceabstract

Block template interface. More...

#include <mining.h>

Public Member Functions

virtual ~BlockTemplate ()=default
 
virtual CBlockHeader getBlockHeader ()=0
 
virtual CBlock getBlock ()=0
 
virtual std::vector< CAmountgetTxFees ()=0
 
virtual std::vector< int64_t > getTxSigops ()=0
 
virtual CTransactionRef getCoinbaseTx ()=0
 
virtual std::vector< unsigned char > getCoinbaseCommitment ()=0
 
virtual int getWitnessCommitmentIndex ()=0
 
virtual std::vector< uint256getCoinbaseMerklePath ()=0
 Compute merkle path to the coinbase transaction. More...
 
virtual bool submitSolution (uint32_t version, uint32_t timestamp, uint32_t nonce, CTransactionRef coinbase)=0
 Construct and broadcast the block. More...
 
virtual std::unique_ptr< BlockTemplatewaitNext (const node::BlockWaitOptions options={})=0
 Waits for fees in the next block to rise, a new tip or the timeout. More...
 

Detailed Description

Block template interface.

Definition at line 31 of file mining.h.

Constructor & Destructor Documentation

◆ ~BlockTemplate()

virtual interfaces::BlockTemplate::~BlockTemplate ( )
virtualdefault

Member Function Documentation

◆ getBlock()

virtual CBlock interfaces::BlockTemplate::getBlock ( )
pure virtual

◆ getBlockHeader()

virtual CBlockHeader interfaces::BlockTemplate::getBlockHeader ( )
pure virtual

◆ getCoinbaseCommitment()

virtual std::vector< unsigned char > interfaces::BlockTemplate::getCoinbaseCommitment ( )
pure virtual

◆ getCoinbaseMerklePath()

virtual std::vector< uint256 > interfaces::BlockTemplate::getCoinbaseMerklePath ( )
pure virtual

Compute merkle path to the coinbase transaction.

Returns
merkle path ordered from the deepest

◆ getCoinbaseTx()

virtual CTransactionRef interfaces::BlockTemplate::getCoinbaseTx ( )
pure virtual

◆ getTxFees()

virtual std::vector< CAmount > interfaces::BlockTemplate::getTxFees ( )
pure virtual

◆ getTxSigops()

virtual std::vector< int64_t > interfaces::BlockTemplate::getTxSigops ( )
pure virtual

◆ getWitnessCommitmentIndex()

virtual int interfaces::BlockTemplate::getWitnessCommitmentIndex ( )
pure virtual

◆ submitSolution()

virtual bool interfaces::BlockTemplate::submitSolution ( uint32_t  version,
uint32_t  timestamp,
uint32_t  nonce,
CTransactionRef  coinbase 
)
pure virtual

Construct and broadcast the block.

Returns
if the block was processed, independent of block validity

◆ waitNext()

virtual std::unique_ptr< BlockTemplate > interfaces::BlockTemplate::waitNext ( const node::BlockWaitOptions  options = {})
pure virtual

Waits for fees in the next block to rise, a new tip or the timeout.

Parameters
[in]optionsControl the timeout (default forever) and by how much total fees for the next block should rise (default infinite).
Returns
a new BlockTemplate or nothing if the timeout occurs.

On testnet this will additionally return a template with difficulty 1 if the tip is more than 20 minutes old.


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