mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
test util: split up ConnectBlock from MineBlock
This commit is contained in:
parent
d1527f6b88
commit
3b85eba83a
2 changed files with 10 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue