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 96 of file mining.h.
◆ ~Mining()
| virtual interfaces::Mining::~Mining |
( |
| ) |
|
|
virtualdefault |
◆ checkBlock()
| virtual bool interfaces::Mining::checkBlock |
( |
const CBlock & |
block, |
|
|
const node::BlockCheckOptions & |
options, |
|
|
std::string & |
reason, |
|
|
std::string & |
debug |
|
) |
| |
|
pure virtual |
Checks if a given block is valid.
- Parameters
-
| [in] | block | the block to check |
| [in] | options | verification options: the proof-of-work check can be skipped in order to verify a template generated by external software. |
| [out] | reason | failure reason (BIP22) |
| [out] | debug | more detailed rejection reason |
- Returns
- whether the block is valid
For signets the challenge verification is skipped when check_pow is false.
◆ context()
Get internal node context.
Useful for RPC and testing, but not accessible across processes.
Definition at line 159 of file mining.h.
◆ createNewBlock()
Construct a new block template.
- Parameters
-
| [in] | options | options for creating the block |
| [in] | cooldown | wait for tip to be connected and IBD to complete. If the best header is ahead of the tip, wait for the tip to catch up. It's recommended to disable this on regtest and signets with only one miner, as these could stall. |
- Return values
-
◆ getTip()
| virtual std::optional< BlockRef > interfaces::Mining::getTip |
( |
| ) |
|
|
pure virtual |
Returns the hash and height for the tip of this chain.
◆ interrupt()
| virtual void interfaces::Mining::interrupt |
( |
| ) |
|
|
pure virtual |
Interrupts createNewBlock and waitTipChanged.
◆ 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.
◆ waitTipChanged()
Waits for the connected tip to change.
During node initialization, this will wait until the tip is connected (regardless of timeout).
- Parameters
-
| [in] | current_tip | block hash of the current chain tip. Function waits for the chain tip to differ from this. |
| [in] | timeout | how long to wait for a new tip (default is forever) |
- Return values
-
| BlockRef | hash and height of the current chain tip after this call. |
| std::nullopt | if the node is shut down or interrupt() is called. |
The documentation for this class was generated from the following file: