diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2018-03-20 14:48:33 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2018-04-07 12:48:27 -0400 |
commit | 9b0f0c5513f74825b06a728ab9bb2fd0e4224c9f (patch) | |
tree | 2bb0998e11f4238330ee72d89314ad2ba5097f04 | |
parent | 398c6f0f9d5ec788997f5574cc0ca9a8a7995950 (diff) |
Add m_ prefix to WalletBatch::m_batch
-rw-r--r-- | src/wallet/walletdb.cpp | 34 | ||||
-rw-r--r-- | 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<uint256>& vTxHash, std::vector<CW 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; } // 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<uint256>& vTxHash, std::vector<CW // 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) @@ -834,25 +834,25 @@ bool WalletBatch::WriteHDChain(const CHDChain& chain) bool WalletBatch::TxnBegin() { - return batch.TxnBegin(); + return m_batch.TxnBegin(); } bool WalletBatch::TxnCommit() { - return batch.TxnCommit(); + return m_batch.TxnCommit(); } bool WalletBatch::TxnAbort() { - return batch.TxnAbort(); + return m_batch.TxnAbort(); } bool WalletBatch::ReadVersion(int& nVersion) { - return batch.ReadVersion(nVersion); + return m_batch.ReadVersion(nVersion); } bool WalletBatch::WriteVersion(int nVersion) { - return batch.WriteVersion(nVersion); + return m_batch.WriteVersion(nVersion); } diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h index fc61228be1..040aa092e1 100644 --- a/src/wallet/walletdb.h +++ b/src/wallet/walletdb.h @@ -144,7 +144,7 @@ private: template <typename K, typename T> 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 <typename K> 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; }; |