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

Interface giving clients (RPC, Stratum v2 Template Provider in the future) ability to create block templates. More...

#include <mining.h>

Public Member Functions

virtual ~Mining ()=default
 
virtual bool isTestChain ()=0
 If this chain is exclusively used for testing. More...
 
virtual bool isInitialBlockDownload ()=0
 Returns whether IBD is still in progress. More...
 
virtual std::optional< BlockRefgetTip ()=0
 Returns the hash and height for the tip of this chain. More...
 
virtual BlockRef waitTipChanged (uint256 current_tip, MillisecondsDouble timeout=MillisecondsDouble::max())=0
 Waits for the connected tip to change. More...
 
virtual std::unique_ptr< BlockTemplatecreateNewBlock (const node::BlockCreateOptions &options={})=0
 Construct a new block template. More...
 
virtual node::NodeContextcontext ()
 Get internal node context. More...
 

Detailed Description

Interface giving clients (RPC, Stratum v2 Template Provider in the future) ability to create block templates.

Definition at line 63 of file mining.h.

Constructor & Destructor Documentation

◆ ~Mining()

virtual interfaces::Mining::~Mining ( )
virtualdefault

Member Function Documentation

◆ context()

virtual node::NodeContext * interfaces::Mining::context ( )
inlinevirtual

Get internal node context.

Useful for RPC and testing, but not accessible across processes.

Definition at line 98 of file mining.h.

◆ createNewBlock()

virtual std::unique_ptr< BlockTemplate > interfaces::Mining::createNewBlock ( const node::BlockCreateOptions options = {})
pure virtual

Construct a new block template.

Parameters
[in]optionsoptions for creating the block
Returns
a block template
Here is the caller graph for this function:

◆ getTip()

virtual std::optional< BlockRef > interfaces::Mining::getTip ( )
pure virtual

Returns the hash and height for the tip of this chain.

Here is the caller graph for this function:

◆ isInitialBlockDownload()

virtual bool interfaces::Mining::isInitialBlockDownload ( )
pure virtual

Returns whether IBD is still in progress.

Here is the caller graph for this function:

◆ isTestChain()

virtual bool interfaces::Mining::isTestChain ( )
pure virtual

If this chain is exclusively used for testing.

Here is the caller graph for this function:

◆ waitTipChanged()

virtual BlockRef interfaces::Mining::waitTipChanged ( uint256  current_tip,
MillisecondsDouble  timeout = MillisecondsDouble::max() 
)
pure virtual

Waits for the connected tip to change.

During node initialization, this will wait until the tip is connected.

Parameters
[in]current_tipblock hash of the current chain tip. Function waits for the chain tip to differ from this.
[in]timeouthow long to wait for a new tip
Returns
Hash and height of the current chain tip after this call.
Here is the caller graph for this function:

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