5 #ifndef BITCOIN_INTERFACES_MINING_H 6 #define BITCOIN_INTERFACES_MINING_H 14 #include <util/time.h> 41 virtual std::vector<CAmount>
getTxFees() = 0;
108 virtual std::optional<BlockRef>
getTip() = 0;
171 #endif // BITCOIN_INTERFACES_MINING_H std::shared_ptr< const CTransaction > CTransactionRef
Block template interface.
virtual CBlockHeader getBlockHeader()=0
virtual ~Mining()=default
virtual std::unique_ptr< BlockTemplate > waitNext(node::BlockWaitOptions options={})=0
Waits for fees in the next block to rise, a new tip or the timeout.
virtual node::CoinbaseTx getCoinbaseTx()=0
Return fields needed to construct a coinbase transaction.
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...
std::unique_ptr< Mining > MakeMining(node::NodeContext &node, bool wait_loaded=true)
Return implementation of Mining interface.
virtual bool submitSolution(uint32_t version, uint32_t timestamp, uint32_t nonce, CTransactionRef coinbase)=0
Construct and broadcast the block.
Template containing all coinbase transaction fields that are set by our miner code.
virtual std::vector< CAmount > getTxFees()=0
virtual void interrupt()=0
Interrupts createNewBlock and waitTipChanged.
virtual std::vector< uint256 > getCoinbaseMerklePath()=0
Compute merkle path to the coinbase transaction.
virtual bool checkBlock(const CBlock &block, const node::BlockCheckOptions &options, std::string &reason, std::string &debug)=0
Checks if a given block is valid.
virtual bool isInitialBlockDownload()=0
Returns whether IBD is still in progress.
virtual node::NodeContext * context()
Get internal node context.
virtual ~BlockTemplate()=default
Serialized script, used inside transaction inputs and outputs.
virtual std::optional< BlockRef > getTip()=0
Returns the hash and height for the tip of this chain.
virtual std::vector< int64_t > getTxSigops()=0
virtual std::optional< BlockRef > waitTipChanged(uint256 current_tip, MillisecondsDouble timeout=MillisecondsDouble::max())=0
Waits for the connected tip to change.
virtual CBlock getBlock()=0
is a home for public enum and struct type definitions that are used internally by node code...
virtual bool isTestChain()=0
If this chain is exclusively used for testing.
std::chrono::duration< double, std::chrono::milliseconds::period > MillisecondsDouble
virtual void interruptWait()=0
Interrupts the current wait for the next block template.
virtual std::unique_ptr< BlockTemplate > createNewBlock(const node::BlockCreateOptions &options={}, bool cooldown=true)=0
Construct a new block template.