5 #ifndef BITCOIN_INTERFACES_MINING_H 6 #define BITCOIN_INTERFACES_MINING_H 15 struct CBlockTemplate;
40 virtual std::optional<uint256>
getTipHash() = 0;
58 virtual bool processNewBlock(
const std::shared_ptr<const CBlock>& block,
bool* new_block) = 0;
86 #endif // BITCOIN_INTERFACES_MINING_H
virtual ~Mining()=default
virtual std::optional< uint256 > getTipHash()=0
Returns the hash for the tip of this chain.
virtual unsigned int getTransactionsUpdated()=0
Return the number of transaction updates in the mempool, used to decide whether to make a new block t...
NodeContext struct containing references to chain state and connection state.
Interface giving clients (RPC, Stratum v2 Template Provider in the future) ability to create block te...
virtual bool processNewBlock(const std::shared_ptr< const CBlock > &block, bool *new_block)=0
Processes new block.
virtual std::unique_ptr< node::CBlockTemplate > createNewBlock(const CScript &script_pub_key, const node::BlockCreateOptions &options={})=0
Construct a new block template.
virtual bool isInitialBlockDownload()=0
Returns whether IBD is still in progress.
virtual node::NodeContext * context()
Get internal node context.
Serialized script, used inside transaction inputs and outputs.
virtual bool testBlockValidity(const CBlock &block, bool check_merkle_root, BlockValidationState &state)=0
Check a block is completely valid from start to finish.
std::unique_ptr< Mining > MakeMining(node::NodeContext &node)
Return implementation of Mining interface.
is a home for public enum and struct type definitions that are used by internally by node code...
virtual bool isTestChain()=0
If this chain is exclusively used for testing.