aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/init.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-07-28 22:59:47 -0400
committerRussell Yanofsky <russ@yanofsky.org>2019-02-22 15:43:02 -0400
commite2c8ba9f6e782e2545b71e9e34b967c69e18c7f0 (patch)
treeb23691d11eac220ec44a617ecf9b32ce3cabb05a /src/wallet/init.cpp
parentc5e59a96a8561b6a0bcaba0ede2d53dbaac113b0 (diff)
downloadbitcoin-e2c8ba9f6e782e2545b71e9e34b967c69e18c7f0.tar.xz
Remove uses of InitMessage/Warning/Error in wallet code
This commit does not change behavior.
Diffstat (limited to 'src/wallet/init.cpp')
-rw-r--r--src/wallet/init.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp
index 20d540c8db..7ad343c15f 100644
--- a/src/wallet/init.cpp
+++ b/src/wallet/init.cpp
@@ -138,12 +138,15 @@ bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wal
// The canonical path cleans the path, preventing >1 Berkeley environment instances for the same directory
fs::path canonical_wallet_dir = fs::canonical(wallet_dir, error);
if (error || !fs::exists(wallet_dir)) {
- return InitError(strprintf(_("Specified -walletdir \"%s\" does not exist"), wallet_dir.string()));
+ chain.initError(strprintf(_("Specified -walletdir \"%s\" does not exist"), wallet_dir.string()));
+ return false;
} else if (!fs::is_directory(wallet_dir)) {
- return InitError(strprintf(_("Specified -walletdir \"%s\" is not a directory"), wallet_dir.string()));
+ chain.initError(strprintf(_("Specified -walletdir \"%s\" is not a directory"), wallet_dir.string()));
+ return false;
// The canonical path transforms relative paths into absolute ones, so we check the non-canonical version
} else if (!wallet_dir.is_absolute()) {
- return InitError(strprintf(_("Specified -walletdir \"%s\" is a relative path"), wallet_dir.string()));
+ chain.initError(strprintf(_("Specified -walletdir \"%s\" is a relative path"), wallet_dir.string()));
+ return false;
}
gArgs.ForceSetArg("-walletdir", canonical_wallet_dir.string());
}
@@ -164,14 +167,15 @@ bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wal
WalletLocation location(wallet_file);
if (!wallet_paths.insert(location.GetPath()).second) {
- return InitError(strprintf(_("Error loading wallet %s. Duplicate -wallet filename specified."), wallet_file));
+ chain.initError(strprintf(_("Error loading wallet %s. Duplicate -wallet filename specified."), wallet_file));
+ return false;
}
std::string error_string;
std::string warning_string;
bool verify_success = CWallet::Verify(chain, location, salvage_wallet, error_string, warning_string);
- if (!error_string.empty()) InitError(error_string);
- if (!warning_string.empty()) InitWarning(warning_string);
+ if (!error_string.empty()) chain.initError(error_string);
+ if (!warning_string.empty()) chain.initWarning(warning_string);
if (!verify_success) return false;
}