mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-07 22:28:02 +02:00
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:
@@ -1207,7 +1207,9 @@ bool AppInitLockDirectories()
|
||||
bool AppInitInterfaces(NodeContext& node)
|
||||
{
|
||||
node.chain = interfaces::MakeChain(node);
|
||||
node.mining = interfaces::MakeMining(node);
|
||||
// Specify wait_loaded=false so internal mining interface can be initialized
|
||||
// on early startup and does not need to be tied to chainstate loading.
|
||||
node.mining = interfaces::MakeMining(node, /*wait_loaded=*/false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user