Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/init.cpp
Show First 20 Lines • Show All 300 Lines • ▼ Show 20 Lines | void WalletInit::RegisterRPC(CRPCTable &t) { | ||||
RegisterWalletRPCCommands(t); | RegisterWalletRPCCommands(t); | ||||
} | } | ||||
bool WalletInit::Verify(const CChainParams &chainParams) { | bool WalletInit::Verify(const CChainParams &chainParams) { | ||||
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) { | if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) { | ||||
return true; | return true; | ||||
} | } | ||||
if (gArgs.IsArgSet("-walletdir") && !fs::is_directory(GetWalletDir())) { | if (gArgs.IsArgSet("-walletdir")) { | ||||
if (fs::exists(fs::system_complete(gArgs.GetArg("-walletdir", "")))) { | fs::path wallet_dir = gArgs.GetArg("-walletdir", ""); | ||||
if (!fs::exists(wallet_dir)) { | |||||
return InitError( | |||||
strprintf(_("Specified -walletdir \"%s\" does not exist"), | |||||
wallet_dir.string())); | |||||
} else if (!fs::is_directory(wallet_dir)) { | |||||
return InitError( | return InitError( | ||||
strprintf(_("Specified -walletdir \"%s\" is not a directory"), | strprintf(_("Specified -walletdir \"%s\" is not a directory"), | ||||
gArgs.GetArg("-walletdir", "").c_str())); | wallet_dir.string())); | ||||
} | } else if (!wallet_dir.is_absolute()) { | ||||
return InitError( | return InitError( | ||||
strprintf(_("Specified -walletdir \"%s\" does not exist"), | strprintf(_("Specified -walletdir \"%s\" is a relative path"), | ||||
gArgs.GetArg("-walletdir", "").c_str())); | wallet_dir.string())); | ||||
} | |||||
} | } | ||||
LogPrintf("Using wallet directory %s\n", GetWalletDir().string()); | LogPrintf("Using wallet directory %s\n", GetWalletDir().string()); | ||||
uiInterface.InitMessage(_("Verifying wallet(s)...")); | uiInterface.InitMessage(_("Verifying wallet(s)...")); | ||||
// Keep track of each wallet absolute path to detect duplicates. | // Keep track of each wallet absolute path to detect duplicates. | ||||
std::set<fs::path> wallet_paths; | std::set<fs::path> wallet_paths; | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |