Skip to content

Commit

Permalink
Generalise walletdir lock error message for correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
meshcollider authored and furszy committed Jul 21, 2021
1 parent ddcfd4a commit d8539bb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/wallet/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,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 PIVX may be using it.", strPath);
return false;
}

strPath = pathIn.string();
fs::path pathLogDir = pathIn / "database";
TryCreateDirectories(pathLogDir);
fs::path pathErrorFile = pathIn / "db.log";
Expand Down Expand Up @@ -307,7 +308,7 @@ bool CDB::VerifyEnvironment(const std::string& walletFile, const fs::path& walle
return UIError(strprintf(_("Wallet %s resides outside data directory %s"), walletFile, walletDir.string()));

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;
}

Expand Down

0 comments on commit d8539bb

Please sign in to comment.