Block template interface.
More...
#include <mining.h>
Block template interface.
Definition at line 29 of file mining.h.
◆ ~BlockTemplate()
| virtual interfaces::BlockTemplate::~BlockTemplate |
( |
| ) |
|
|
virtualdefault |
◆ getBlock()
| virtual CBlock interfaces::BlockTemplate::getBlock |
( |
| ) |
|
|
pure virtual |
◆ getBlockHeader()
| virtual CBlockHeader interfaces::BlockTemplate::getBlockHeader |
( |
| ) |
|
|
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()
Return fields needed to construct a coinbase transaction.
◆ getTxFees()
| virtual std::vector< CAmount > interfaces::BlockTemplate::getTxFees |
( |
| ) |
|
|
pure virtual |
◆ getTxSigops()
| virtual std::vector< int64_t > interfaces::BlockTemplate::getTxSigops |
( |
| ) |
|
|
pure virtual |
◆ interruptWait()
| virtual void interfaces::BlockTemplate::interruptWait |
( |
| ) |
|
|
pure virtual |
Interrupts the current wait for the next block template.
◆ submitSolution()
| virtual bool interfaces::BlockTemplate::submitSolution |
( |
uint32_t |
version, |
|
|
uint32_t |
timestamp, |
|
|
uint32_t |
nonce, |
|
|
CTransactionRef |
coinbase |
|
) |
| |
|
pure virtual |
Construct and broadcast the block.
Modifies the template in place, updating the fields listed below as well as the merkle root.
- Parameters
-
| [in] | version | version block header field |
| [in] | timestamp | time block header field (unix timestamp) |
| [in] | nonce | nonce block header field |
| [in] | coinbase | complete coinbase transaction (including witness) |
- Note
- Unlike the submitblock RPC, this method does not call UpdateUncommittedBlockStructures to add a missing coinbase witness reserved value. Callers must provide a complete coinbase transaction, including the witness when a witness commitment is present.
-
for heights <= 16, the BIP34 height push in getCoinbaseTx().script_sig_prefix is only one byte long, so the coinbase scriptSig needs at least one additional byte of data to avoid bad-cb-length.
- Returns
- if the block was processed, does not necessarily indicate validity.
- Note
- Returns true if the block is already known, which can happen if the solved block is constructed and broadcast by multiple nodes (e.g. both the miner who constructed the template and the pool).
◆ waitNext()
Waits for fees in the next block to rise, a new tip or the timeout.
- Parameters
-
| [in] | options | Control 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: