Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/init.cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2017 The Bitcoin Core developers | // Copyright (c) 2009-2017 The Bitcoin Core developers | ||||
// Copyright (c) 2018-2020 The Bitcoin developers | // Copyright (c) 2018-2020 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <config.h> | #include <config.h> | ||||
#include <init.h> | #include <init.h> | ||||
#include <interfaces/chain.h> | #include <interfaces/chain.h> | ||||
#include <net.h> | #include <net.h> | ||||
#include <network.h> | #include <network.h> | ||||
#include <node/context.h> | #include <node/context.h> | ||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
#include <util/check.h> | |||||
#include <util/moneystr.h> | #include <util/moneystr.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <util/translation.h> | #include <util/translation.h> | ||||
#include <wallet/coincontrol.h> | #include <wallet/coincontrol.h> | ||||
#include <wallet/rpcdump.h> | #include <wallet/rpcdump.h> | ||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
#include <walletinitinterface.h> | #include <walletinitinterface.h> | ||||
▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | if (gArgs.GetBoolArg("-sysperms", false)) { | ||||
Untranslated("-sysperms is not allowed in combination with enabled " | Untranslated("-sysperms is not allowed in combination with enabled " | ||||
"wallet functionality")); | "wallet functionality")); | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
void WalletInit::Construct(NodeContext &node) const { | void WalletInit::Construct(NodeContext &node) const { | ||||
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) { | ArgsManager &args = *Assert(node.args); | ||||
if (args.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) { | |||||
LogPrintf("Wallet disabled!\n"); | LogPrintf("Wallet disabled!\n"); | ||||
return; | return; | ||||
} | } | ||||
gArgs.SoftSetArg("-wallet", ""); | args.SoftSetArg("-wallet", ""); | ||||
node.chain_clients.emplace_back( | node.chain_clients.emplace_back(interfaces::MakeWalletClient( | ||||
interfaces::MakeWalletClient(*node.chain, gArgs.GetArgs("-wallet"))); | *node.chain, args, args.GetArgs("-wallet"))); | ||||
} | } |