wallet: remove outdated pszSkip arg of database Rewrite func
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.
This commit is contained in:
6 files changed
+8
-8
No files matched your search
+2
-2
@@ -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
|
//! Counts the number of active database users to be sure that the database is not closed while someone is using it
|
||||||
std::atomic<int> m_refcount{0};
|
std::atomic<int> 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.
|
/** Back up the entire database to a file.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ public:
|
|||||||
/** Open the database if it is not already opened. */
|
/** Open the database if it is not already opened. */
|
||||||
void Open() override;
|
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.
|
/** Back up the entire database to a file.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
// Rewrite the database using the VACUUM command: https://sqlite.org/lang_vacuum.html
|
||||||
int ret = sqlite3_exec(m_db, "VACUUM", nullptr, nullptr, nullptr);
|
int ret = sqlite3_exec(m_db, "VACUUM", nullptr, nullptr, nullptr);
|
||||||
|
|||||||
+1
-1
@@ -140,7 +140,7 @@ public:
|
|||||||
void Close() override;
|
void Close() override;
|
||||||
|
|
||||||
/** Rewrite the entire database on disk */
|
/** Rewrite the entire database on disk */
|
||||||
bool Rewrite(const char* skip = nullptr) override;
|
bool Rewrite() override;
|
||||||
|
|
||||||
/** Back up the entire database to a file.
|
/** Back up the entire database to a file.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public:
|
|||||||
|
|
||||||
void Open() override {}
|
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; }
|
bool Backup(const std::string& strDest) const override { return m_pass; }
|
||||||
void Close() override {}
|
void Close() override {}
|
||||||
|
|
||||||
|
|||||||
@@ -2266,7 +2266,7 @@ DBErrors CWallet::LoadWallet()
|
|||||||
DBErrors nLoadWalletRet = WalletBatch(GetDatabase()).LoadWallet(this);
|
DBErrors nLoadWalletRet = WalletBatch(GetDatabase()).LoadWallet(this);
|
||||||
if (nLoadWalletRet == DBErrors::NEED_REWRITE)
|
if (nLoadWalletRet == DBErrors::NEED_REWRITE)
|
||||||
{
|
{
|
||||||
if (GetDatabase().Rewrite("\x04pool"))
|
if (GetDatabase().Rewrite())
|
||||||
{
|
{
|
||||||
for (const auto& spk_man_pair : m_spk_managers) {
|
for (const auto& spk_man_pair : m_spk_managers) {
|
||||||
spk_man_pair.second->RewriteDB();
|
spk_man_pair.second->RewriteDB();
|
||||||
|
|||||||
Reference in new issue
Block a user