8
8
#include < fs.h>
9
9
#include < interfaces/chain.h>
10
10
#include < scheduler.h>
11
+ #include < util/check.h>
11
12
#include < util/string.h>
12
13
#include < util/system.h>
13
14
#include < util/translation.h>
20
21
bool VerifyWallets (WalletContext& context)
21
22
{
22
23
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" , " " );
25
28
boost::system::error_code error;
26
29
// The canonical path cleans the path, preventing >1 Berkeley environment instances for the same directory
27
30
fs::path canonical_wallet_dir = fs::canonical (wallet_dir, error);
@@ -36,7 +39,7 @@ bool VerifyWallets(WalletContext& context)
36
39
chain.initError (strprintf (_ (" Specified -walletdir \" %s\" is a relative path" ), wallet_dir.string ()));
37
40
return false ;
38
41
}
39
- gArgs .ForceSetArg (" -walletdir" , canonical_wallet_dir.string ());
42
+ args .ForceSetArg (" -walletdir" , canonical_wallet_dir.string ());
40
43
}
41
44
42
45
LogPrintf (" Using wallet directory %s\n " , GetWalletDir ().string ());
@@ -45,7 +48,7 @@ bool VerifyWallets(WalletContext& context)
45
48
46
49
// For backwards compatibility if an unnamed top level wallet exists in the
47
50
// wallets directory, include it in the default list of wallets to load.
48
- if (!gArgs .IsArgSet (" wallet" )) {
51
+ if (!args .IsArgSet (" wallet" )) {
49
52
DatabaseOptions options;
50
53
DatabaseStatus status;
51
54
bilingual_str error_string;
0 commit comments