Pass NodeContext, ConnMan, BanMan references more places

So g_connman and g_banman globals can be removed next commit.
This commit is contained in:
Russell Yanofsky
2019-09-17 18:28:03 -04:00
parent 4d5448c76b
commit e6f4f895d5
34 changed files with 154 additions and 62 deletions

View File

@@ -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);