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 97 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 152 of file mining.h.
◆ createNewBlock()
Construct a new block template.
During node initialization, this will wait until the tip is connected.
- Parameters
-
| [in] | options | options for creating the block |
- Return values
-
| BlockTemplate | a block template. |
| std::nullptr | if the node is shut down. |
◆ getTip()
| virtual std::optional< BlockRef > interfaces::Mining::getTip |
( |
| ) |
|
|
pure virtual |
Returns the hash and height for the tip of this chain.
◆ 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. |
The documentation for this class was generated from the following file: