MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / MakeMining

Function MakeMining

src/node/interfaces.cpp:1068–1080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1066std::unique_ptr<Node> MakeNode(node::NodeContext& context) { return std::make_unique<node::NodeImpl>(context); }
1067std::unique_ptr<Chain> MakeChain(node::NodeContext& context) { return std::make_unique<node::ChainImpl>(context); }
1068std::unique_ptr<Mining> MakeMining(const node::NodeContext& context, bool wait_loaded)
1069{
1070 if (wait_loaded) {
1071 node::KernelNotifications& kernel_notifications(*Assert(context.notifications));
1072 util::SignalInterrupt& interrupt(*Assert(context.shutdown_signal));
1073 WAIT_LOCK(kernel_notifications.m_tip_block_mutex, lock);
1074 kernel_notifications.m_tip_block_cv.wait(lock, [&]() EXCLUSIVE_LOCKS_REQUIRED(kernel_notifications.m_tip_block_mutex) {
1075 return kernel_notifications.m_state.chainstate_loaded || interrupt;
1076 });
1077 if (interrupt) return nullptr;
1078 }
1079 return std::make_unique<node::MinerImpl>(context);
1080}
1081std::unique_ptr<Rpc> MakeRpc(node::NodeContext& context) { return std::make_unique<node::RpcImpl>(context); }
1082} // namespace interfaces

Callers 15

AppInitInterfacesFunction · 0.85
makeMiningMethod · 0.85
makeMiningMethod · 0.85
makeMiningMethod · 0.85
makeMiningMethod · 0.85
CreateBlockMethod · 0.85
mineBlockFunction · 0.85
MakeMiningMethod · 0.85
TestPackageSelectionMethod · 0.85
TestBasicMiningMethod · 0.85
TestPrioritisedMiningMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 2

EXCLUSIVE_LOCKS_REQUIREDFunction · 0.70
waitMethod · 0.45

Tested by 13

CreateBlockMethod · 0.68
mineBlockFunction · 0.68
MakeMiningMethod · 0.68
TestPackageSelectionMethod · 0.68
TestBasicMiningMethod · 0.68
TestPrioritisedMiningMethod · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BlockMethod · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
MakeMiningMethod · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
PrepareBlockFunction · 0.68