From 301bd41a2e6765b185bd55f4c541f9e27aeea29d Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Tue, 17 Sep 2019 17:04:39 -0400 Subject: scripted-diff: Rename InitInterfaces to NodeContext -BEGIN VERIFY SCRIPT- s() { git grep -l "$1" src | xargs sed -i "s/$1/$2/g"; } s 'struct InitInterfaces' 'struct NodeContext' s 'InitInterfaces interfaces' 'NodeContext node' s 'InitInterfaces& interfaces' 'NodeContext\& node' s 'InitInterfaces m_interfaces' 'NodeContext m_context' s 'InitInterfaces\* g_rpc_interfaces' 'NodeContext* g_rpc_node' s 'g_rpc_interfaces = &interfaces' 'g_rpc_node = \&node' s 'g_rpc_interfaces' 'g_rpc_node' s 'm_interfaces' 'm_context' s 'interfaces\.chain' 'node.chain' s '\(AppInitMain\|Shutdown\|Construct\)(interfaces)' '\1(node)' s 'init interfaces' 'chain clients' -END VERIFY SCRIPT- --- src/bitcoind.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index ddd6f8839c..1d51ee8f78 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -39,8 +39,8 @@ static void WaitForShutdown() // static bool AppInit(int argc, char* argv[]) { - InitInterfaces interfaces; - interfaces.chain = interfaces::MakeChain(); + NodeContext node; + node.chain = interfaces::MakeChain(); bool fRet = false; @@ -142,7 +142,7 @@ static bool AppInit(int argc, char* argv[]) // If locking the data directory failed, exit immediately return false; } - fRet = AppInitMain(interfaces); + fRet = AppInitMain(node); } catch (const std::exception& e) { PrintExceptionContinue(&e, "AppInit()"); @@ -156,7 +156,7 @@ static bool AppInit(int argc, char* argv[]) } else { WaitForShutdown(); } - Shutdown(interfaces); + Shutdown(node); return fRet; } -- cgit v1.2.3 From e6f4f895d5e42feaf7bfa5f41e80292aaa73cd7d Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Tue, 17 Sep 2019 18:28:03 -0400 Subject: Pass NodeContext, ConnMan, BanMan references more places So g_connman and g_banman globals can be removed next commit. --- src/bitcoind.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 1d51ee8f78..be1d60ee52 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -24,13 +25,13 @@ const std::function 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); -- cgit v1.2.3