mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-25 14:28:53 +02:00
Add checkBlock to Mining interface
Use it in miner_tests. The getblocktemplate and generateblock RPC calls don't use this, because it would make the code more verbose.
This commit is contained in:
@@ -114,6 +114,21 @@ public:
|
||||
*/
|
||||
virtual std::unique_ptr<BlockTemplate> createNewBlock(const node::BlockCreateOptions& options = {}) = 0;
|
||||
|
||||
/**
|
||||
* Checks if a given block is valid.
|
||||
*
|
||||
* @param[in] block the block to check
|
||||
* @param[in] options verification options: the proof-of-work check can be
|
||||
* skipped in order to verify a template generated by
|
||||
* external software.
|
||||
* @param[out] reason failure reason (BIP22)
|
||||
* @param[out] debug more detailed rejection reason
|
||||
* @returns whether the block is valid
|
||||
*
|
||||
* For signets the challenge verification is skipped when check_pow is false.
|
||||
*/
|
||||
virtual bool checkBlock(const CBlock& block, const node::BlockCheckOptions& options, std::string& reason, std::string& debug) = 0;
|
||||
|
||||
//! Get internal node context. Useful for RPC and testing,
|
||||
//! but not accessible across processes.
|
||||
virtual node::NodeContext* context() { return nullptr; }
|
||||
|
||||
Reference in New Issue
Block a user