@@ -121,7 +121,7 @@ bool WalletBatch::WriteCryptedKey(const CPubKey& vchPubKey,
121
121
if (!WriteIC (key, std::make_pair (vchCryptedSecret, checksum), false )) {
122
122
// It may already exist, so try writing just the checksum
123
123
std::vector<unsigned char > val;
124
- if (!m_batch. Read (key, val)) {
124
+ if (!m_batch-> Read (key, val)) {
125
125
return false ;
126
126
}
127
127
if (!WriteIC (key, std::make_pair (val, checksum), true )) {
@@ -166,8 +166,8 @@ bool WalletBatch::WriteBestBlock(const CBlockLocator& locator)
166
166
167
167
bool WalletBatch::ReadBestBlock (CBlockLocator& locator)
168
168
{
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);
171
171
}
172
172
173
173
bool WalletBatch::WriteOrderPosNext (int64_t nOrderPosNext)
@@ -177,7 +177,7 @@ bool WalletBatch::WriteOrderPosNext(int64_t nOrderPosNext)
177
177
178
178
bool WalletBatch::ReadPool (int64_t nPool, CKeyPool& keypool)
179
179
{
180
- return m_batch. Read (std::make_pair (DBKeys::POOL, nPool), keypool);
180
+ return m_batch-> Read (std::make_pair (DBKeys::POOL, nPool), keypool);
181
181
}
182
182
183
183
bool WalletBatch::WritePool (int64_t nPool, const CKeyPool& keypool)
@@ -693,14 +693,14 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
693
693
LOCK (pwallet->cs_wallet );
694
694
try {
695
695
int nMinVersion = 0 ;
696
- if (m_batch. Read (DBKeys::MINVERSION, nMinVersion)) {
696
+ if (m_batch-> Read (DBKeys::MINVERSION, nMinVersion)) {
697
697
if (nMinVersion > FEATURE_LATEST)
698
698
return DBErrors::TOO_NEW;
699
699
pwallet->LoadMinVersion (nMinVersion);
700
700
}
701
701
702
702
// Get cursor
703
- if (!m_batch. StartCursor ())
703
+ if (!m_batch-> StartCursor ())
704
704
{
705
705
pwallet->WalletLogPrintf (" Error getting wallet database cursor\n " );
706
706
return DBErrors::CORRUPT;
@@ -712,13 +712,13 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
712
712
CDataStream ssKey (SER_DISK, CLIENT_VERSION);
713
713
CDataStream ssValue (SER_DISK, CLIENT_VERSION);
714
714
bool complete;
715
- bool ret = m_batch. ReadAtCursor (ssKey, ssValue, complete);
715
+ bool ret = m_batch-> ReadAtCursor (ssKey, ssValue, complete);
716
716
if (complete) {
717
717
break ;
718
718
}
719
719
else if (!ret)
720
720
{
721
- m_batch. CloseCursor ();
721
+ m_batch-> CloseCursor ();
722
722
pwallet->WalletLogPrintf (" Error reading next record from wallet database\n " );
723
723
return DBErrors::CORRUPT;
724
724
}
@@ -748,7 +748,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
748
748
} catch (...) {
749
749
result = DBErrors::CORRUPT;
750
750
}
751
- m_batch. CloseCursor ();
751
+ m_batch-> CloseCursor ();
752
752
753
753
// Set the active ScriptPubKeyMans
754
754
for (auto spk_man_pair : wss.m_active_external_spks ) {
@@ -785,7 +785,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
785
785
786
786
// Last client version to open this wallet, was previously the file version number
787
787
int last_client = CLIENT_VERSION;
788
- m_batch. Read (DBKeys::VERSION, last_client);
788
+ m_batch-> Read (DBKeys::VERSION, last_client);
789
789
790
790
int wallet_version = pwallet->GetVersion ();
791
791
pwallet->WalletLogPrintf (" Wallet File Version = %d\n " , wallet_version > 0 ? wallet_version : last_client);
@@ -810,7 +810,7 @@ DBErrors WalletBatch::LoadWallet(CWallet* pwallet)
810
810
return DBErrors::NEED_REWRITE;
811
811
812
812
if (last_client < CLIENT_VERSION) // Update
813
- m_batch. Write (DBKeys::VERSION, CLIENT_VERSION);
813
+ m_batch-> Write (DBKeys::VERSION, CLIENT_VERSION);
814
814
815
815
if (wss.fAnyUnordered )
816
816
result = pwallet->ReorderTransactions ();
@@ -846,13 +846,13 @@ DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWal
846
846
847
847
try {
848
848
int nMinVersion = 0 ;
849
- if (m_batch. Read (DBKeys::MINVERSION, nMinVersion)) {
849
+ if (m_batch-> Read (DBKeys::MINVERSION, nMinVersion)) {
850
850
if (nMinVersion > FEATURE_LATEST)
851
851
return DBErrors::TOO_NEW;
852
852
}
853
853
854
854
// Get cursor
855
- if (!m_batch. StartCursor ())
855
+ if (!m_batch-> StartCursor ())
856
856
{
857
857
LogPrintf (" Error getting wallet database cursor\n " );
858
858
return DBErrors::CORRUPT;
@@ -864,11 +864,11 @@ DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWal
864
864
CDataStream ssKey (SER_DISK, CLIENT_VERSION);
865
865
CDataStream ssValue (SER_DISK, CLIENT_VERSION);
866
866
bool complete;
867
- bool ret = m_batch. ReadAtCursor (ssKey, ssValue, complete);
867
+ bool ret = m_batch-> ReadAtCursor (ssKey, ssValue, complete);
868
868
if (complete) {
869
869
break ;
870
870
} else if (!ret) {
871
- m_batch. CloseCursor ();
871
+ m_batch-> CloseCursor ();
872
872
LogPrintf (" Error reading next record from wallet database\n " );
873
873
return DBErrors::CORRUPT;
874
874
}
@@ -886,7 +886,7 @@ DBErrors WalletBatch::FindWalletTx(std::vector<uint256>& vTxHash, std::list<CWal
886
886
} catch (...) {
887
887
result = DBErrors::CORRUPT;
888
888
}
889
- m_batch. CloseCursor ();
889
+ m_batch-> CloseCursor ();
890
890
891
891
return result;
892
892
}
@@ -999,17 +999,17 @@ bool WalletBatch::WriteWalletFlags(const uint64_t flags)
999
999
1000
1000
bool WalletBatch::TxnBegin ()
1001
1001
{
1002
- return m_batch. TxnBegin ();
1002
+ return m_batch-> TxnBegin ();
1003
1003
}
1004
1004
1005
1005
bool WalletBatch::TxnCommit ()
1006
1006
{
1007
- return m_batch. TxnCommit ();
1007
+ return m_batch-> TxnCommit ();
1008
1008
}
1009
1009
1010
1010
bool WalletBatch::TxnAbort ()
1011
1011
{
1012
- return m_batch. TxnAbort ();
1012
+ return m_batch-> TxnAbort ();
1013
1013
}
1014
1014
1015
1015
bool IsWalletLoaded (const fs::path& wallet_path)
0 commit comments