aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeshCollider <dobsonsa68@gmail.com>2017-12-24 12:45:33 +1300
committerMeshCollider <dobsonsa68@gmail.com>2018-01-16 19:05:45 +1300
commit64226de908c76997fadf147342c494ad0662fa43 (patch)
tree19810e302a362ed8a16c794d214bd411730bfa2d
parentc9ed4bd58cac05b355ab103476ff29ecd10ce263 (diff)
Generalise walletdir lock error message for correctness
-rw-r--r--src/wallet/db.cpp5
-rwxr-xr-xtest/functional/multiwallet.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index c0c24ae98b..a647a5b025 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -121,11 +121,12 @@ bool CDBEnv::Open(const fs::path& pathIn, bool retry)
boost::this_thread::interruption_point();
+ strPath = pathIn.string();
if (!LockEnvDirectory(pathIn)) {
+ LogPrintf("Cannot obtain a lock on wallet directory %s. Another instance of bitcoin may be using it.", strPath);
return false;
}
- strPath = pathIn.string();
fs::path pathLogDir = pathIn / "database";
TryCreateDirectories(pathLogDir);
fs::path pathErrorFile = pathIn / "db.log";
@@ -310,7 +311,7 @@ bool CDB::VerifyEnvironment(const std::string& walletFile, const fs::path& walle
}
if (!bitdb.Open(walletDir, true)) {
- errorStr = strprintf(_("Cannot obtain a lock on wallet directory %s. Another instance of bitcoin may be using it."), walletDir);
+ errorStr = strprintf(_("Error initializing wallet database environment %s!"), walletDir);
return false;
}
diff --git a/test/functional/multiwallet.py b/test/functional/multiwallet.py
index 38e2a8bfec..0891829127 100755
--- a/test/functional/multiwallet.py
+++ b/test/functional/multiwallet.py
@@ -71,7 +71,7 @@ class MultiWalletTest(BitcoinTestFramework):
competing_wallet_dir = os.path.join(self.options.tmpdir, 'competing_walletdir')
os.mkdir(competing_wallet_dir)
self.restart_node(0, ['-walletdir='+competing_wallet_dir])
- self.assert_start_raises_init_error(1, ['-walletdir='+competing_wallet_dir], 'Cannot obtain a lock on wallet directory')
+ self.assert_start_raises_init_error(1, ['-walletdir='+competing_wallet_dir], 'Error initializing wallet database environment')
self.restart_node(0, self.extra_args[0])