mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 13:13:49 +01:00
Pass NodeContext, ConnMan, BanMan references more places
So g_connman and g_banman globals can be removed next commit.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <compat.h>
|
||||
#include <init.h>
|
||||
#include <interfaces/chain.h>
|
||||
#include <node/context.h>
|
||||
#include <noui.h>
|
||||
#include <shutdown.h>
|
||||
#include <ui_interface.h>
|
||||
@@ -24,13 +25,13 @@
|
||||
|
||||
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
|
||||
|
||||
static void WaitForShutdown()
|
||||
static void WaitForShutdown(NodeContext& node)
|
||||
{
|
||||
while (!ShutdownRequested())
|
||||
{
|
||||
MilliSleep(200);
|
||||
}
|
||||
Interrupt();
|
||||
Interrupt(node);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@@ -40,7 +41,7 @@ static void WaitForShutdown()
|
||||
static bool AppInit(int argc, char* argv[])
|
||||
{
|
||||
NodeContext node;
|
||||
node.chain = interfaces::MakeChain();
|
||||
node.chain = interfaces::MakeChain(node);
|
||||
|
||||
bool fRet = false;
|
||||
|
||||
@@ -152,9 +153,9 @@ static bool AppInit(int argc, char* argv[])
|
||||
|
||||
if (!fRet)
|
||||
{
|
||||
Interrupt();
|
||||
Interrupt(node);
|
||||
} else {
|
||||
WaitForShutdown();
|
||||
WaitForShutdown(node);
|
||||
}
|
||||
Shutdown(node);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user