Interface giving clients (RPC, Stratum v2 Template Provider in the future) ability to create block templates.
More...
#include <mining.h>
Interface giving clients (RPC, Stratum v2 Template Provider in the future) ability to create block templates.
Definition at line 28 of file mining.h.
◆ ~Mining()
| virtual interfaces::Mining::~Mining |
( |
| ) |
|
|
virtualdefault |
◆ context()
Get internal node context.
Useful for RPC and testing, but not accessible across processes.
Definition at line 78 of file mining.h.
◆ createNewBlock()
Construct a new block template.
- Parameters
-
| [in] | script_pub_key | the coinbase output |
| [in] | options | options for creating the block |
- Returns
- a block template
◆ getTipHash()
| virtual std::optional<uint256> interfaces::Mining::getTipHash |
( |
| ) |
|
|
pure virtual |
Returns the hash for the tip of this chain.
◆ getTransactionsUpdated()
| virtual unsigned int interfaces::Mining::getTransactionsUpdated |
( |
| ) |
|
|
pure virtual |
Return the number of transaction updates in the mempool, used to decide whether to make a new block template.
◆ isInitialBlockDownload()
| virtual bool interfaces::Mining::isInitialBlockDownload |
( |
| ) |
|
|
pure virtual |
Returns whether IBD is still in progress.
◆ isTestChain()
| virtual bool interfaces::Mining::isTestChain |
( |
| ) |
|
|
pure virtual |
If this chain is exclusively used for testing.
◆ processNewBlock()
| virtual bool interfaces::Mining::processNewBlock |
( |
const std::shared_ptr< const CBlock > & |
block, |
|
|
bool * |
new_block |
|
) |
| |
|
pure virtual |
Processes new block.
A valid new block is automatically relayed to peers.
- Parameters
-
| [in] | block | The block we want to process. |
| [out] | new_block | A boolean which is set to indicate if the block was first received via this call |
- Returns
- If the block was processed, independently of block validity
◆ testBlockValidity()
Check a block is completely valid from start to finish.
Only works on top of our current best block. Does not check proof-of-work.
- Parameters
-
| [in] | block | the block to validate |
| [in] | check_merkle_root | call CheckMerkleRoot() |
| [out] | state | details of why a block failed to validate |
- Returns
- false if it does not build on the current tip, or any of the checks fail
The documentation for this class was generated from the following file: