Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

walletutil.cpp
Go to the documentation of this file.
1 // Copyright (c) 2017 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <wallet/walletutil.h>
6 
7 fs::path GetWalletDir()
8 {
9  fs::path path;
10 
11  if (gArgs.IsArgSet("-walletdir")) {
12  path = gArgs.GetArg("-walletdir", "");
13  if (!fs::is_directory(path)) {
14  // If the path specified doesn't exist, we return the deliberately
15  // invalid empty string.
16  path = "";
17  }
18  } else {
19  path = GetDataDir();
20  // If a wallets directory exists, use that, otherwise default to GetDataDir
21  if (fs::is_directory(path / "wallets")) {
22  path /= "wallets";
23  }
24  }
25 
26  return path;
27 }
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
Definition: util.cpp:784
fs::path GetWalletDir()
Get the path of the wallet directory.
Definition: walletutil.cpp:7
ArgsManager gArgs
Definition: util.cpp:108
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
Definition: util.cpp:808
const fs::path & GetDataDir(bool fNetSpecific)
Definition: util.cpp:928
Released under the MIT license