diff --git a/src/wallet/sqlite.cpp b/src/wallet/sqlite.cpp index fb0bef14ee3..7d96575a643 100644 --- a/src/wallet/sqlite.cpp +++ b/src/wallet/sqlite.cpp @@ -161,6 +161,11 @@ bool SQLiteDatabase::Backup(const std::string& dest) const void SQLiteDatabase::Close() { + int res = sqlite3_close(m_db); + if (res != SQLITE_OK) { + throw std::runtime_error(strprintf("SQLiteDatabase: Failed to close database: %s\n", sqlite3_errstr(res))); + } + m_db = nullptr; } std::unique_ptr SQLiteDatabase::MakeBatch(bool flush_on_close)