Add waitNext() to BlockTemplate interface

This commit is contained in:
Sjors Provoost
2024-12-18 10:42:35 +07:00
parent 785649f397
commit d4020f502a
5 changed files with 157 additions and 11 deletions

View File

@@ -7,7 +7,7 @@
#include <consensus/amount.h> // for CAmount
#include <interfaces/types.h> // for BlockRef
#include <node/types.h> // for BlockCreateOptions
#include <node/types.h> // for BlockCreateOptions, BlockWaitOptions
#include <primitives/block.h> // for CBlock, CBlockHeader
#include <primitives/transaction.h> // for CTransactionRef
#include <stdint.h> // for int64_t
@@ -56,6 +56,16 @@ public:
* @returns if the block was processed, independent of block validity
*/
virtual bool submitSolution(uint32_t version, uint32_t timestamp, uint32_t nonce, CTransactionRef coinbase) = 0;
/**
* Waits for fees in the next block to rise, a new tip or the timeout.
*
* @param[in] options Control the timeout (default forever) and by how much total fees
* for the next block should rise (default infinite).
*
* @returns a new BlockTemplate or nothing if the timeout occurs.
*/
virtual std::unique_ptr<BlockTemplate> waitNext(const node::BlockWaitOptions options = {}) = 0;
};
//! Interface giving clients (RPC, Stratum v2 Template Provider in the future)