diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -29,9 +29,10 @@ // CWalletDB // -bool CWalletDB::WriteName(const std::string &strAddress, const std::string &strName) { +bool CWalletDB::WriteName(const std::string &strAddress, + const std::string &strName) { nWalletDBUpdateCounter++; - return Write(make_pair(std::string("name"), strAddress), strName); + return Write(std::make_pair(std::string("name"), strAddress), strName); } bool CWalletDB::EraseName(const std::string &strAddress) { @@ -39,18 +40,19 @@ // addresses, receiving addresses must always have an address book entry if // they're not change return. nWalletDBUpdateCounter++; - return Erase(make_pair(std::string("name"), strAddress)); + return Erase(std::make_pair(std::string("name"), strAddress)); } bool CWalletDB::WritePurpose(const std::string &strAddress, const std::string &strPurpose) { nWalletDBUpdateCounter++; - return Write(make_pair(std::string("purpose"), strAddress), strPurpose); + return Write(std::make_pair(std::string("purpose"), strAddress), + strPurpose); } bool CWalletDB::ErasePurpose(const std::string &strPurpose) { nWalletDBUpdateCounter++; - return Erase(make_pair(std::string("purpose"), strPurpose)); + return Erase(std::make_pair(std::string("purpose"), strPurpose)); } bool CWalletDB::WriteTx(const CWalletTx &wtx) { @@ -178,12 +180,12 @@ bool CWalletDB::ReadAccount(const std::string &strAccount, CAccount &account) { account.SetNull(); - return Read(make_pair(std::string("acc"), strAccount), account); + return Read(std::make_pair(std::string("acc"), strAccount), account); } bool CWalletDB::WriteAccount(const std::string &strAccount, const CAccount &account) { - return Write(make_pair(std::string("acc"), strAccount), account); + return Write(std::make_pair(std::string("acc"), strAccount), account); } bool CWalletDB::WriteAccountingEntry(const uint64_t nAccEntryNum, @@ -217,7 +219,7 @@ Dbc *pcursor = GetCursor(); if (!pcursor) throw std::runtime_error(std::string(__func__) + - ": cannot create DB cursor"); + ": cannot create DB cursor"); bool setRange = true; while (true) { // Read next record @@ -234,7 +236,8 @@ break; else if (ret != 0) { pcursor->close(); - throw std::runtime_error(std::string(__func__) + ": error scanning DB"); + throw std::runtime_error(std::string(__func__) + + ": error scanning DB"); } // Unserialize @@ -273,7 +276,8 @@ }; bool ReadKeyValue(CWallet *pwallet, CDataStream &ssKey, CDataStream &ssValue, - CWalletScanState &wss, std::string &strType, std::string &strErr) { + CWalletScanState &wss, std::string &strType, + std::string &strErr) { try { // Unserialize // Taking advantage of the fact that pair serialization is just the two @@ -592,14 +596,15 @@ pwallet->laccentries.clear(); ListAccountCreditDebit("*", pwallet->laccentries); for (CAccountingEntry &entry : pwallet->laccentries) { - pwallet->wtxOrdered.insert(make_pair( + pwallet->wtxOrdered.insert(std::make_pair( entry.nOrderPos, CWallet::TxPair((CWalletTx *)0, &entry))); } return result; } -DBErrors CWalletDB::FindWalletTx(CWallet *pwallet, std::vector &vTxHash, +DBErrors CWalletDB::FindWalletTx(CWallet *pwallet, + std::vector &vTxHash, std::vector &vWtx) { pwallet->vchDefaultKey = CPubKey(); bool fNoncriticalErrors = false; @@ -658,7 +663,8 @@ return result; } -DBErrors CWalletDB::ZapSelectTx(CWallet *pwallet, std::vector &vTxHashIn, +DBErrors CWalletDB::ZapSelectTx(CWallet *pwallet, + std::vector &vTxHashIn, std::vector &vTxHashOut) { // Build list of wallet TXs and hashes. std::vector vTxHash; @@ -698,7 +704,8 @@ return DB_LOAD_OK; } -DBErrors CWalletDB::ZapWalletTx(CWallet *pwallet, std::vector &vWtx) { +DBErrors CWalletDB::ZapWalletTx(CWallet *pwallet, + std::vector &vWtx) { // Build list of wallet TXs. std::vector vTxHash; DBErrors err = FindWalletTx(pwallet, vTxHash, vWtx); @@ -738,7 +745,8 @@ if (lockDb) { // Don't do this if any databases are in use. int nRefCount = 0; - std::map::iterator mi = bitdb.mapFileUseCount.begin(); + std::map::iterator mi = + bitdb.mapFileUseCount.begin(); while (mi != bitdb.mapFileUseCount.end()) { nRefCount += (*mi).second; mi++;