mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-04 20:51:14 +00:00
bitcoin-gui code needs to call SetupServerArgs but will not have a NodeContext object if it is communicating with an external bitcoin-node process.
32 lines
763 B
C++
32 lines
763 B
C++
// Copyright (c) 2021 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#include <interfaces/init.h>
|
|
#include <node/context.h>
|
|
#include <util/system.h>
|
|
|
|
#include <memory>
|
|
|
|
namespace init {
|
|
namespace {
|
|
class BitcoindInit : public interfaces::Init
|
|
{
|
|
public:
|
|
BitcoindInit(NodeContext& node) : m_node(node)
|
|
{
|
|
m_node.args = &gArgs;
|
|
m_node.init = this;
|
|
}
|
|
NodeContext& m_node;
|
|
};
|
|
} // namespace
|
|
} // namespace init
|
|
|
|
namespace interfaces {
|
|
std::unique_ptr<Init> MakeNodeInit(NodeContext& node, int argc, char* argv[], int& exit_status)
|
|
{
|
|
return std::make_unique<init::BitcoindInit>(node);
|
|
}
|
|
} // namespace interfaces
|