mirror of https://github.com/bitcoin/bitcoin
parent
99bc0b428b
commit
0530ba0eae
@ -0,0 +1,23 @@
|
||||
// Copyright (c) 2017 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 "wallet/walletutil.h"
|
||||
|
||||
fs::path GetWalletDir()
|
||||
{
|
||||
fs::path path;
|
||||
|
||||
if (gArgs.IsArgSet("-walletdir")) {
|
||||
path = fs::system_complete(gArgs.GetArg("-walletdir", ""));
|
||||
if (!fs::is_directory(path)) {
|
||||
// If the path specified doesn't exist, we return the deliberately
|
||||
// invalid empty string.
|
||||
path = "";
|
||||
}
|
||||
} else {
|
||||
path = GetDataDir();
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
// Copyright (c) 2017 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef BITCOIN_WALLET_UTIL_H
|
||||
#define BITCOIN_WALLET_UTIL_H
|
||||
|
||||
#include "util.h"
|
||||
|
||||
//! Get the path of the wallet directory.
|
||||
fs::path GetWalletDir();
|
||||
|
||||
#endif // BITCOIN_WALLET_UTIL_H
|
Loading…
Reference in new issue