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()) {