mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
test util: split up ConnectBlock from MineBlock
This commit is contained in:
@ -92,6 +92,11 @@ COutPoint MineBlock(const NodeContext& node, std::shared_ptr<CBlock>& block)
|
|||||||
assert(block->nNonce);
|
assert(block->nNonce);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ProcessBlock(node, block);
|
||||||
|
}
|
||||||
|
|
||||||
|
COutPoint ProcessBlock(const NodeContext& node, const std::shared_ptr<CBlock>& block)
|
||||||
|
{
|
||||||
auto& chainman{*Assert(node.chainman)};
|
auto& chainman{*Assert(node.chainman)};
|
||||||
const auto old_height = WITH_LOCK(chainman.GetMutex(), return chainman.ActiveHeight());
|
const auto old_height = WITH_LOCK(chainman.GetMutex(), return chainman.ActiveHeight());
|
||||||
bool new_block;
|
bool new_block;
|
||||||
|
@ -32,6 +32,11 @@ COutPoint MineBlock(const node::NodeContext&,
|
|||||||
**/
|
**/
|
||||||
COutPoint MineBlock(const node::NodeContext&, std::shared_ptr<CBlock>& block);
|
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 */
|
/** Prepare a block to be mined */
|
||||||
std::shared_ptr<CBlock> PrepareBlock(const node::NodeContext&);
|
std::shared_ptr<CBlock> PrepareBlock(const node::NodeContext&);
|
||||||
std::shared_ptr<CBlock> PrepareBlock(const node::NodeContext& node,
|
std::shared_ptr<CBlock> PrepareBlock(const node::NodeContext& node,
|
||||||
|
Reference in New Issue
Block a user