From 9b0f0c5513f74825b06a728ab9bb2fd0e4224c9f Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Tue, 20 Mar 2018 14:48:33 -0400 Subject: Add m_ prefix to WalletBatch::m_batch --- src/wallet/walletdb.cpp | 34 +++++++++++++++++----------------- src/wallet/walletdb.h | 8 ++++---- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index bcf3ba7b67..57261bb922 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -121,8 +121,8 @@ bool WalletBatch::WriteBestBlock(const CBlockLocator& locator) bool WalletBatch::ReadBestBlock(CBlockLocator& locator) { - if (batch.Read(std::string("bestblock"), locator) && !locator.vHave.empty()) return true; - return batch.Read(std::string("bestblock_nomerkle"), locator); + if (m_batch.Read(std::string("bestblock"), locator) && !locator.vHave.empty()) return true; + return m_batch.Read(std::string("bestblock_nomerkle"), locator); } bool WalletBatch::WriteOrderPosNext(int64_t nOrderPosNext) @@ -132,7 +132,7 @@ bool WalletBatch::WriteOrderPosNext(int64_t nOrderPosNext) bool WalletBatch::ReadPool(int64_t nPool, CKeyPool& keypool) { - return batch.Read(std::make_pair(std::string("pool"), nPool), keypool); + return m_batch.Read(std::make_pair(std::string("pool"), nPool), keypool); } bool WalletBatch::WritePool(int64_t nPool, const CKeyPool& keypool) @@ -153,7 +153,7 @@ bool WalletBatch::WriteMinVersion(int nVersion) bool WalletBatch::ReadAccount(const std::string& strAccount, CAccount& account) { account.SetNull(); - return batch.Read(std::make_pair(std::string("acc"), strAccount), account); + return m_batch.Read(std::make_pair(std::string("acc"), strAccount), account); } bool WalletBatch::WriteAccount(const std::string& strAccount, const CAccount& account) @@ -182,7 +182,7 @@ void WalletBatch::ListAccountCreditDebit(const std::string& strAccount, std::lis { bool fAllAccounts = (strAccount == "*"); - Dbc* pcursor = batch.GetCursor(); + Dbc* pcursor = m_batch.GetCursor(); if (!pcursor) throw std::runtime_error(std::string(__func__) + ": cannot create DB cursor"); bool setRange = true; @@ -193,7 +193,7 @@ void WalletBatch::ListAccountCreditDebit(const std::string& strAccount, std::lis if (setRange) ssKey << std::make_pair(std::string("acentry"), std::make_pair((fAllAccounts ? std::string("") : strAccount), uint64_t(0))); CDataStream ssValue(SER_DISK, CLIENT_VERSION); - int ret = batch.ReadAtCursor(pcursor, ssKey, ssValue, setRange); + int ret = m_batch.ReadAtCursor(pcursor, ssKey, ssValue, setRange); setRange = false; if (ret == DB_NOTFOUND) break; @@ -527,7 +527,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet) LOCK(pwallet->cs_wallet); try { int nMinVersion = 0; - if (batch.Read((std::string)"minversion", nMinVersion)) + if (m_batch.Read((std::string)"minversion", nMinVersion)) { if (nMinVersion > CLIENT_VERSION) return DBErrors::TOO_NEW; @@ -535,7 +535,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet) } // Get cursor - Dbc* pcursor = batch.GetCursor(); + Dbc* pcursor = m_batch.GetCursor(); if (!pcursor) { LogPrintf("Error getting wallet database cursor\n"); @@ -547,7 +547,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet) // Read next record CDataStream ssKey(SER_DISK, CLIENT_VERSION); CDataStream ssValue(SER_DISK, CLIENT_VERSION); - int ret = batch.ReadAtCursor(pcursor, ssKey, ssValue); + int ret = m_batch.ReadAtCursor(pcursor, ssKey, ssValue); if (ret == DB_NOTFOUND) break; else if (ret != 0) @@ -630,14 +630,14 @@ DBErrors WalletBatch::FindWalletTx(std::vector& vTxHash, std::vector CLIENT_VERSION) return DBErrors::TOO_NEW; } // Get cursor - Dbc* pcursor = batch.GetCursor(); + Dbc* pcursor = m_batch.GetCursor(); if (!pcursor) { LogPrintf("Error getting wallet database cursor\n"); @@ -649,7 +649,7 @@ DBErrors WalletBatch::FindWalletTx(std::vector& vTxHash, std::vector bool WriteIC(const K& key, const T& value, bool fOverwrite = true) { - if (!batch.Write(key, value, fOverwrite)) { + if (!m_batch.Write(key, value, fOverwrite)) { return false; } m_database.IncrementUpdateCounter(); @@ -154,7 +154,7 @@ private: template bool EraseIC(const K& key) { - if (!batch.Erase(key)) { + if (!m_batch.Erase(key)) { return false; } m_database.IncrementUpdateCounter(); @@ -163,7 +163,7 @@ private: public: explicit WalletBatch(WalletDatabase& database, const char* pszMode = "r+", bool _fFlushOnClose = true) : - batch(database, pszMode, _fFlushOnClose), + m_batch(database, pszMode, _fFlushOnClose), m_database(database) { } @@ -244,7 +244,7 @@ public: //! Write wallet version bool WriteVersion(int nVersion); private: - BerkeleyBatch batch; + BerkeleyBatch m_batch; WalletDatabase& m_database; }; -- cgit v1.2.3