From 61039d72a5da443a254b3229748fc64eee613757 Mon Sep 17 00:00:00 2001 From: rkrux Date: Thu, 15 Jan 2026 15:36:21 +0530 Subject: [PATCH] wallet: remove unimplemented `RewriteDB` calls from SPKM ISTM that there is no implementation left of the `RewriteDB` method in any of the SPKMs, and thus, its call sites can be removed safely. --- src/wallet/scriptpubkeyman.h | 3 --- src/wallet/wallet.cpp | 10 ++-------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h index 00dd6eed4d1..cf024294bf3 100644 --- a/src/wallet/scriptpubkeyman.h +++ b/src/wallet/scriptpubkeyman.h @@ -120,9 +120,6 @@ public: virtual bool HavePrivateKeys() const { return false; } virtual bool HaveCryptedKeys() const { return false; } - //! The action to do when the DB needs rewrite - virtual void RewriteDB() {} - virtual unsigned int GetKeyPoolSize() const { return 0; } virtual int64_t GetTimeFirstKey() const { return 0; } diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index b1562952257..e1e0d307ccc 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2357,14 +2357,8 @@ DBErrors CWallet::PopulateWalletFromDB(bilingual_str& error, std::vectorRewriteDB(); - } - } + if (nLoadWalletRet == DBErrors::NEED_REWRITE) { + GetDatabase().Rewrite(); } if (m_spk_managers.empty()) {