Skip to content

Commit c3c2132

Browse files
committed
Use context.args in src/wallet/load.cpp.
1 parent 25de4e7 commit c3c2132

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/wallet/load.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <fs.h>
99
#include <interfaces/chain.h>
1010
#include <scheduler.h>
11+
#include <util/check.h>
1112
#include <util/string.h>
1213
#include <util/system.h>
1314
#include <util/translation.h>
@@ -20,8 +21,10 @@
2021
bool VerifyWallets(WalletContext& context)
2122
{
2223
interfaces::Chain& chain = *context.chain;
23-
if (gArgs.IsArgSet("-walletdir")) {
24-
fs::path wallet_dir = gArgs.GetArg("-walletdir", "");
24+
ArgsManager& args = *Assert(context.args);
25+
26+
if (args.IsArgSet("-walletdir")) {
27+
fs::path wallet_dir = args.GetArg("-walletdir", "");
2528
boost::system::error_code error;
2629
// The canonical path cleans the path, preventing >1 Berkeley environment instances for the same directory
2730
fs::path canonical_wallet_dir = fs::canonical(wallet_dir, error);
@@ -36,7 +39,7 @@ bool VerifyWallets(WalletContext& context)
3639
chain.initError(strprintf(_("Specified -walletdir \"%s\" is a relative path"), wallet_dir.string()));
3740
return false;
3841
}
39-
gArgs.ForceSetArg("-walletdir", canonical_wallet_dir.string());
42+
args.ForceSetArg("-walletdir", canonical_wallet_dir.string());
4043
}
4144

4245
LogPrintf("Using wallet directory %s\n", GetWalletDir().string());
@@ -45,7 +48,7 @@ bool VerifyWallets(WalletContext& context)
4548

4649
// For backwards compatibility if an unnamed top level wallet exists in the
4750
// wallets directory, include it in the default list of wallets to load.
48-
if (!gArgs.IsArgSet("wallet")) {
51+
if (!args.IsArgSet("wallet")) {
4952
DatabaseOptions options;
5053
DatabaseStatus status;
5154
bilingual_str error_string;

0 commit comments

Comments
 (0)