Skip to content

Commit 900bb53

Browse files
committed
Merge bitcoin/bitcoin#32990: wallet: remove outdated pszSkip arg of database Rewrite func
2dfeb66 wallet: remove outdated `pszSkip` arg of database `Rewrite` func (rkrux) Pull request description: This argument might have been used in the legacy wallets, but I don't see any implementation using this argument in the SQLite wallets. Removing it cleans up the code a bit. ACKs for top commit: achow101: ACK 2dfeb66 brunoerg: code review ACK 2dfeb66 Tree-SHA512: de2178ad6862125f084434ec6a7271d567544870c474c5ea2e75a4f69f3f5eb2170ff46947e098f58e1fa47c35bbe4ebafcd8180581d1f100f1f8d177b32dd91
2 parents c8ec423 + 2dfeb66 commit 900bb53

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/wallet/db.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ class WalletDatabase
139139
//! Counts the number of active database users to be sure that the database is not closed while someone is using it
140140
std::atomic<int> m_refcount{0};
141141

142-
/** Rewrite the entire database on disk, with the exception of key pszSkip if non-zero
142+
/** Rewrite the entire database on disk
143143
*/
144-
virtual bool Rewrite(const char* pszSkip=nullptr) = 0;
144+
virtual bool Rewrite() = 0;
145145

146146
/** Back up the entire database to a file.
147147
*/

src/wallet/migrate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class BerkeleyRODatabase : public WalletDatabase
3535
/** Open the database if it is not already opened. */
3636
void Open() override;
3737

38-
/** Rewrite the entire database on disk, with the exception of key pszSkip if non-zero
38+
/** Rewrite the entire database on disk
3939
*/
40-
bool Rewrite(const char* pszSkip = nullptr) override { return false; }
40+
bool Rewrite() override { return false; }
4141

4242
/** Back up the entire database to a file.
4343
*/

src/wallet/sqlite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ void SQLiteDatabase::Open()
336336
}
337337
}
338338

339-
bool SQLiteDatabase::Rewrite(const char* skip)
339+
bool SQLiteDatabase::Rewrite()
340340
{
341341
// Rewrite the database using the VACUUM command: https://sqlite.org/lang_vacuum.html
342342
int ret = sqlite3_exec(m_db, "VACUUM", nullptr, nullptr, nullptr);

src/wallet/sqlite.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class SQLiteDatabase : public WalletDatabase
140140
void Close() override;
141141

142142
/** Rewrite the entire database on disk */
143-
bool Rewrite(const char* skip = nullptr) override;
143+
bool Rewrite() override;
144144

145145
/** Back up the entire database to a file.
146146
*/

src/wallet/test/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class MockableDatabase : public WalletDatabase
104104

105105
void Open() override {}
106106

107-
bool Rewrite(const char* pszSkip=nullptr) override { return m_pass; }
107+
bool Rewrite() override { return m_pass; }
108108
bool Backup(const std::string& strDest) const override { return m_pass; }
109109
void Close() override {}
110110

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2266,7 +2266,7 @@ DBErrors CWallet::LoadWallet()
22662266
DBErrors nLoadWalletRet = WalletBatch(GetDatabase()).LoadWallet(this);
22672267
if (nLoadWalletRet == DBErrors::NEED_REWRITE)
22682268
{
2269-
if (GetDatabase().Rewrite("\x04pool"))
2269+
if (GetDatabase().Rewrite())
22702270
{
22712271
for (const auto& spk_man_pair : m_spk_managers) {
22722272
spk_man_pair.second->RewriteDB();

0 commit comments

Comments
 (0)