ipc mining: Prevent `Assertion m_node.chainman' failed`` errors on early startup

This fixes ``Assertion `m_node.chainman' failed`` errors first reported
https://github.com/bitcoin/bitcoin/issues/33994#issuecomment-3602551596 when
IPC mining methods are called before ChainstateManager is loaded.

The fix works by making the `Init.makeMining` method block until chainstate
data is loaded.
This commit is contained in:
Ryan Ofsky
2026-02-24 08:31:38 -05:00
parent a7cabf92e4
commit bbc8f1e0a7
6 changed files with 52 additions and 5 deletions

View File

@@ -67,7 +67,7 @@ struct MinerTestingSetup : public TestingSetup {
}
std::unique_ptr<Mining> MakeMining()
{
return interfaces::MakeMining(m_node);
return interfaces::MakeMining(m_node, /*wait_loaded=*/false);
}
};
} // namespace miner_tests