aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/db.cpp
diff options
context:
space:
mode:
authorGlenn Willen <gwillen@nerdnet.org>2019-03-06 13:22:41 -0800
committerGlenn Willen <gwillen@nerdnet.org>2019-03-14 18:49:19 -0700
commitfaf369880822188f2738c6f046d9ef14c9585713 (patch)
treee16897d77ccb2c21bb4ba22ead17925767bcb50f /src/wallet/db.cpp
parent4952a953585e99477a89989b009749e40c173013 (diff)
downloadbitcoin-faf369880822188f2738c6f046d9ef14c9585713.tar.xz
wallet: Improve log output for errors during load
When loading the wallet, display the entire path in error messages, instead of the name (which, for the default wallet, is the empty string.) When an exception occurs during wallet loading, display e.what() if possible, instead of nothing.
Diffstat (limited to 'src/wallet/db.cpp')
-rw-r--r--src/wallet/db.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index 99d880daa0..6a326bfd97 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -84,6 +84,14 @@ bool IsWalletLoaded(const fs::path& wallet_path)
return database && database->IsDatabaseLoaded(database_filename);
}
+fs::path WalletDataFilePath(const fs::path& wallet_path)
+{
+ fs::path env_directory;
+ std::string database_filename;
+ SplitWalletPath(wallet_path, env_directory, database_filename);
+ return env_directory / database_filename;
+}
+
/**
* @param[in] wallet_path Path to wallet directory. Or (for backwards compatibility only) a path to a berkeley btree data file inside a wallet directory.
* @param[out] database_filename Filename of berkeley btree data file inside the wallet directory.