diff --git a/src/wallet/db.h b/src/wallet/db.h index ac7ba3324e0..b953ab1f25b 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -139,9 +139,9 @@ public: //! Counts the number of active database users to be sure that the database is not closed while someone is using it std::atomic m_refcount{0}; - /** Rewrite the entire database on disk, with the exception of key pszSkip if non-zero + /** Rewrite the entire database on disk */ - virtual bool Rewrite(const char* pszSkip=nullptr) = 0; + virtual bool Rewrite() = 0; /** Back up the entire database to a file. */ diff --git a/src/wallet/migrate.h b/src/wallet/migrate.h index e72df288521..22174ea430b 100644 --- a/src/wallet/migrate.h +++ b/src/wallet/migrate.h @@ -35,9 +35,9 @@ public: /** Open the database if it is not already opened. */ void Open() override; - /** Rewrite the entire database on disk, with the exception of key pszSkip if non-zero + /** Rewrite the entire database on disk */ - bool Rewrite(const char* pszSkip = nullptr) override { return false; } + bool Rewrite() override { return false; } /** Back up the entire database to a file. */ diff --git a/src/wallet/sqlite.cpp b/src/wallet/sqlite.cpp index 993f58420cb..2653d863755 100644 --- a/src/wallet/sqlite.cpp +++ b/src/wallet/sqlite.cpp @@ -336,7 +336,7 @@ void SQLiteDatabase::Open() } } -bool SQLiteDatabase::Rewrite(const char* skip) +bool SQLiteDatabase::Rewrite() { // Rewrite the database using the VACUUM command: https://sqlite.org/lang_vacuum.html int ret = sqlite3_exec(m_db, "VACUUM", nullptr, nullptr, nullptr); diff --git a/src/wallet/sqlite.h b/src/wallet/sqlite.h index 895cfb12dd4..c34597e60be 100644 --- a/src/wallet/sqlite.h +++ b/src/wallet/sqlite.h @@ -140,7 +140,7 @@ public: void Close() override; /** Rewrite the entire database on disk */ - bool Rewrite(const char* skip = nullptr) override; + bool Rewrite() override; /** Back up the entire database to a file. */ diff --git a/src/wallet/test/util.h b/src/wallet/test/util.h index 4c84a1713f2..ecedbd90807 100644 --- a/src/wallet/test/util.h +++ b/src/wallet/test/util.h @@ -104,7 +104,7 @@ public: void Open() override {} - bool Rewrite(const char* pszSkip=nullptr) override { return m_pass; } + bool Rewrite() override { return m_pass; } bool Backup(const std::string& strDest) const override { return m_pass; } void Close() override {} diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 3d83f356f64..65aa9b7f01d 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2266,7 +2266,7 @@ DBErrors CWallet::LoadWallet() DBErrors nLoadWalletRet = WalletBatch(GetDatabase()).LoadWallet(this); if (nLoadWalletRet == DBErrors::NEED_REWRITE) { - if (GetDatabase().Rewrite("\x04pool")) + if (GetDatabase().Rewrite()) { for (const auto& spk_man_pair : m_spk_managers) { spk_man_pair.second->RewriteDB();