mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-02 01:04:43 +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:
@@ -160,7 +160,11 @@ public:
|
||||
};
|
||||
|
||||
//! Return implementation of Mining interface.
|
||||
std::unique_ptr<Mining> MakeMining(node::NodeContext& node);
|
||||
//!
|
||||
//! @param[in] wait_loaded waits for chainstate data to be loaded before
|
||||
//! returning. Used to prevent external clients from
|
||||
//! being able to crash the node during startup.
|
||||
std::unique_ptr<Mining> MakeMining(node::NodeContext& node, bool wait_loaded=true);
|
||||
|
||||
} // namespace interfaces
|
||||
|
||||
|
||||
Reference in New Issue
Block a user