@@ -121,7 +121,7 @@ bool WalletBatch::WriteCryptedKey(const CPubKey& vchPubKey,
121121 if (!WriteIC (key, std::make_pair (vchCryptedSecret, checksum), false )) {
122122 // It may already exist, so try writing just the checksum
123123 std::vector<unsigned char > val;
124- if (!m_batch. Read (key, val)) {
124+ if (!m_batch-> Read (key, val)) {
125125 return false ;
126126 }
127127 if (!WriteIC (key, std::make_pair (val, checksum), true )) {
@@ -166,8 +166,8 @@ bool WalletBatch::WriteBestBlock(const CBlockLocator& locator)
166166
167167bool WalletBatch::ReadBestBlock (CBlockLocator& locator)
168168{
169- if (m_batch. Read (DBKeys::BESTBLOCK, locator) && !locator.vHave .empty ()) return true ;
170- return m_batch. Read (DBKeys::BESTBLOCK_NOMERKLE, locator);
169+ if (m_batch-> Read (DBKeys::BESTBLOCK, locator) && !locator.vHave .empty ()) return true ;
170+ return m_batch-> Read (DBKeys::BESTBLOCK_NOMERKLE, locator);
171171}
172172
173173bool WalletBatch::WriteOrderPosNext (int64_t nOrderPosNext)
@@ -177,7 +177,7 @@ bool WalletBatch::WriteOrderPosNext(int64_t nOrderPosNext)
177177
178178bool WalletBatch::ReadPool (int64_t nPool, CKeyPool& keypool)
179179{
180- return m_batch. Read (std::make_pair (DBKeys::POOL, nPool), keypool);
180+ return m_batch-> Read (std::make_pair (DBKeys::POOL, nPool), keypool);
181181}
182182
183183bool WalletBatch::WritePool (int64_t nPool, const CKeyPool& keypool)
@@ -693,14 +693,14 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
693693 LOCK (pwallet->cs_wallet );
694694 try {
695695 int nMinVersion = 0 ;
696- if (m_batch. Read (DBKeys::MINVERSION, nMinVersion)) {
696+ if (m_batch-> Read (DBKeys::MINVERSION, nMinVersion)) {
697697 if (nMinVersion > FEATURE_LATEST)
698698 return DBErrors::TOO_NEW;
699699 pwallet->LoadMinVersion (nMinVersion);
700700 }
701701
702702 // Get cursor
703- if (!m_batch. StartCursor ())
703+ if (!m_batch-> StartCursor ())
704704 {
705705 pwallet->WalletLogPrintf (" Error getting wallet database cursor\n " );
706706 return DBErrors::CORRUPT;
@@ -712,13 +712,13 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
712712 CDataStream ssKey (SER_DISK, CLIENT_VERSION);
713713 CDataStream ssValue (SER_DISK, CLIENT_VERSION);
714714 bool complete;
715- bool ret = m_batch. ReadAtCursor (ssKey, ssValue, complete);
715+ bool ret = m_batch-> ReadAtCursor (ssKey, ssValue, complete);
716716 if (complete) {
717717 break ;
718718 }
719719 else if (!ret)
720720 {
721- m_batch. CloseCursor ();
721+ m_batch-> CloseCursor ();
722722 pwallet->WalletLogPrintf (" Error reading next record from wallet database\n " );
723723 return DBErrors::CORRUPT;
724724 }
@@ -748,7 +748,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
748748 } catch (...) {
749749 result = DBErrors::CORRUPT;
750750 }
751- m_batch. CloseCursor ();
751+ m_batch-> CloseCursor ();
752752
753753 // Set the active ScriptPubKeyMans
754754 for (auto spk_man_pair : wss.m_active_external_spks ) {
@@ -785,7 +785,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
785785
786786 // Last client version to open this wallet, was previously the file version number
787787 int last_client = CLIENT_VERSION;
788- m_batch. Read (DBKeys::VERSION, last_client);
788+ m_batch-> Read (DBKeys::VERSION, last_client);
789789
790790 int wallet_version = pwallet->GetVersion ();
791791 pwallet->WalletLogPrintf (" Wallet File Version = %d\n " , wallet_version > 0 ? wallet_version : last_client);
@@ -810,7 +810,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
810810 return DBErrors::NEED_REWRITE;
811811
812812 if (last_client < CLIENT_VERSION) // Update
813- m_batch. Write (DBKeys::VERSION, CLIENT_VERSION);
813+ m_batch-> Write (DBKeys::VERSION, CLIENT_VERSION);
814814
815815 if (wss.fAnyUnordered )
816816 result = pwallet->ReorderTransactions ();
@@ -846,13 +846,13 @@ DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWal
846846
847847 try {
848848 int nMinVersion = 0 ;
849- if (m_batch. Read (DBKeys::MINVERSION, nMinVersion)) {
849+ if (m_batch-> Read (DBKeys::MINVERSION, nMinVersion)) {
850850 if (nMinVersion > FEATURE_LATEST)
851851 return DBErrors::TOO_NEW;
852852 }
853853
854854 // Get cursor
855- if (!m_batch. StartCursor ())
855+ if (!m_batch-> StartCursor ())
856856 {
857857 LogPrintf (" Error getting wallet database cursor\n " );
858858 return DBErrors::CORRUPT;
@@ -864,11 +864,11 @@ DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWal
864864 CDataStream ssKey (SER_DISK, CLIENT_VERSION);
865865 CDataStream ssValue (SER_DISK, CLIENT_VERSION);
866866 bool complete;
867- bool ret = m_batch. ReadAtCursor (ssKey, ssValue, complete);
867+ bool ret = m_batch-> ReadAtCursor (ssKey, ssValue, complete);
868868 if (complete) {
869869 break ;
870870 } else if (!ret) {
871- m_batch. CloseCursor ();
871+ m_batch-> CloseCursor ();
872872 LogPrintf (" Error reading next record from wallet database\n " );
873873 return DBErrors::CORRUPT;
874874 }
@@ -886,7 +886,7 @@ DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWal
886886 } catch (...) {
887887 result = DBErrors::CORRUPT;
888888 }
889- m_batch. CloseCursor ();
889+ m_batch-> CloseCursor ();
890890
891891 return result;
892892}
@@ -999,17 +999,17 @@ bool WalletBatch::WriteWalletFlags(const uint64_t flags)
999999
10001000bool WalletBatch::TxnBegin ()
10011001{
1002- return m_batch. TxnBegin ();
1002+ return m_batch-> TxnBegin ();
10031003}
10041004
10051005bool WalletBatch::TxnCommit ()
10061006{
1007- return m_batch. TxnCommit ();
1007+ return m_batch-> TxnCommit ();
10081008}
10091009
10101010bool WalletBatch::TxnAbort ()
10111011{
1012- return m_batch. TxnAbort ();
1012+ return m_batch-> TxnAbort ();
10131013}
10141014
10151015bool IsWalletLoaded (const fs::path& wallet_path)
0 commit comments