diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index 36946b7dc..53cfcf096 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -148,7 +148,7 @@ void CDBEnv::MakeMock() fMockDb = true; } -CDBEnv::VerifyResult CDBEnv::Verify(std::string strFile, bool (*recoverFunc)(CDBEnv& dbenv, std::string strFile)) +CDBEnv::VerifyResult CDBEnv::Verify(const std::string& strFile, bool (*recoverFunc)(CDBEnv& dbenv, const std::string& strFile)) { LOCK(cs_db); assert(mapFileUseCount.count(strFile) == 0); @@ -165,7 +165,7 @@ CDBEnv::VerifyResult CDBEnv::Verify(std::string strFile, bool (*recoverFunc)(CDB return (fRecovered ? RECOVER_OK : RECOVER_FAIL); } -bool CDBEnv::Salvage(std::string strFile, bool fAggressive, std::vector& vResult) +bool CDBEnv::Salvage(const std::string& strFile, bool fAggressive, std::vector& vResult) { LOCK(cs_db); assert(mapFileUseCount.count(strFile) == 0); diff --git a/src/wallet/db.h b/src/wallet/db.h index 71133f969..0c2c139d8 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -59,7 +59,7 @@ public: enum VerifyResult { VERIFY_OK, RECOVER_OK, RECOVER_FAIL }; - VerifyResult Verify(std::string strFile, bool (*recoverFunc)(CDBEnv& dbenv, std::string strFile)); + VerifyResult Verify(const std::string& strFile, bool (*recoverFunc)(CDBEnv& dbenv, const std::string& strFile)); /** * Salvage data from a file that Verify says is bad. * fAggressive sets the DB_AGGRESSIVE flag (see berkeley DB->verify() method documentation). @@ -68,7 +68,7 @@ public: * for huge databases. */ typedef std::pair, std::vector > KeyValPair; - bool Salvage(std::string strFile, bool fAggressive, std::vector& vResult); + bool Salvage(const std::string& strFile, bool fAggressive, std::vector& vResult); bool Open(const boost::filesystem::path& path); void Close(); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 44b416d49..167639b53 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -345,7 +345,7 @@ void CWallet::Flush(bool shutdown) bitdb.Flush(shutdown); } -bool CWallet::Verify(const string walletFile, string& warningString, string& errorString) +bool CWallet::Verify(const string& walletFile, string& warningString, string& errorString) { if (!bitdb.Open(GetDataDir())) { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 1a9feff9f..f00fb0caf 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -747,7 +747,7 @@ public: void Flush(bool shutdown=false); //! Verify the wallet database and perform salvage if required - static bool Verify(const std::string walletFile, std::string& warningString, std::string& errorString); + static bool Verify(const std::string& walletFile, std::string& warningString, std::string& errorString); /** * Address book entry changed. diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 880026d18..d7f70e435 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -891,7 +891,7 @@ bool BackupWallet(const CWallet& wallet, const string& strDest) // // Try to (very carefully!) recover wallet.dat if there is a problem. // -bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) +bool CWalletDB::Recover(CDBEnv& dbenv, const std::string& filename, bool fOnlyKeys) { // Recovery procedure: // move wallet.dat to wallet.timestamp.bak @@ -968,7 +968,7 @@ bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys) return fSuccess; } -bool CWalletDB::Recover(CDBEnv& dbenv, std::string filename) +bool CWalletDB::Recover(CDBEnv& dbenv, const std::string& filename) { return CWalletDB::Recover(dbenv, filename, false); } diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h index 6aa0fa40d..a1c38b9d3 100644 --- a/src/wallet/walletdb.h +++ b/src/wallet/walletdb.h @@ -127,8 +127,8 @@ public: DBErrors LoadWallet(CWallet* pwallet); DBErrors FindWalletTx(CWallet* pwallet, std::vector& vTxHash, std::vector& vWtx); DBErrors ZapWalletTx(CWallet* pwallet, std::vector& vWtx); - static bool Recover(CDBEnv& dbenv, std::string filename, bool fOnlyKeys); - static bool Recover(CDBEnv& dbenv, std::string filename); + static bool Recover(CDBEnv& dbenv, const std::string& filename, bool fOnlyKeys); + static bool Recover(CDBEnv& dbenv, const std::string& filename); private: CWalletDB(const CWalletDB&);