test util: split up ConnectBlock from MineBlock
This commit is contained in:
1 parent
d1527f6b88
commit
3b85eba83a
2 files changed
+10
No files matched your search
@@ -92,6 +92,11 @@ COutPoint MineBlock(const NodeContext& node, std::shared_ptr<CBlock>& block)
|
||||
assert(block->nNonce);
|
||||
}
|
||||
|
||||
return ProcessBlock(node, block);
|
||||
}
|
||||
|
||||
COutPoint ProcessBlock(const NodeContext& node, const std::shared_ptr<CBlock>& block)
|
||||
{
|
||||
auto& chainman{*Assert(node.chainman)};
|
||||
const auto old_height = WITH_LOCK(chainman.GetMutex(), return chainman.ActiveHeight());
|
||||
bool new_block;
|
||||
|
||||
@@ -32,6 +32,11 @@ COutPoint MineBlock(const node::NodeContext&,
|
||||
**/
|
||||
COutPoint MineBlock(const node::NodeContext&, std::shared_ptr<CBlock>& block);
|
||||
|
||||
/**
|
||||
* Returns the generated coin (or Null if the block was invalid).
|
||||
*/
|
||||
COutPoint ProcessBlock(const node::NodeContext&, const std::shared_ptr<CBlock>& block);
|
||||
|
||||
/** Prepare a block to be mined */
|
||||
std::shared_ptr<CBlock> PrepareBlock(const node::NodeContext&);
|
||||
std::shared_ptr<CBlock> PrepareBlock(const node::NodeContext& node,
|
||||
|
||||
Reference in new issue
Block a user