mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
refactor: Add InitContext function to initialize NodeContext with global pointers
Having InitContext() avoids the need to add duplicate code to src/init/*.cpp files in the next commit. It also lets these files avoid referencing global variables like gArgs. There is no change in behavior in this commit.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <common/args.h>
|
||||
#include <init.h>
|
||||
#include <interfaces/chain.h>
|
||||
#include <interfaces/echo.h>
|
||||
#include <interfaces/init.h>
|
||||
@@ -23,7 +23,7 @@ class BitcoinGuiInit : public interfaces::Init
|
||||
public:
|
||||
BitcoinGuiInit(const char* arg0) : m_ipc(interfaces::MakeIpc(EXE_NAME, arg0, *this))
|
||||
{
|
||||
m_node.args = &gArgs;
|
||||
InitContext(m_node);
|
||||
m_node.init = this;
|
||||
}
|
||||
std::unique_ptr<interfaces::Node> makeNode() override { return interfaces::MakeNode(m_node); }
|
||||
|
||||
Reference in New Issue
Block a user