rpc: call CreateNewBlock via miner interface

This commit is contained in:
Sjors Provoost
2024-06-10 17:03:33 +02:00
parent 404b01c436
commit 4bf2e361da
3 changed files with 30 additions and 12 deletions

View File

@@ -8,11 +8,13 @@
#include <uint256.h>
namespace node {
struct CBlockTemplate;
struct NodeContext;
} // namespace node
class BlockValidationState;
class CBlock;
class CScript;
namespace interfaces {
@@ -30,6 +32,15 @@ public:
//! Returns the hash for the tip of this chain, 0 if none
virtual uint256 getTipHash() = 0;
/**
* Construct a new block template
*
* @param[in] script_pub_key the coinbase output
* @param[in] use_mempool set false to omit mempool transactions
* @returns a block template
*/
virtual std::unique_ptr<node::CBlockTemplate> createNewBlock(const CScript& script_pub_key, bool use_mempool = true) = 0;
/**
* Check a block is completely valid from start to finish.
* Only works on top of our current best block.