Skip to content

Commit 9382535

Browse files
committed
Implement SQLiteDatabase::Close
1 parent a0de833 commit 9382535

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/wallet/sqlite.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ bool SQLiteDatabase::Backup(const std::string& dest) const
161161

162162
void SQLiteDatabase::Close()
163163
{
164+
int res = sqlite3_close(m_db);
165+
if (res != SQLITE_OK) {
166+
throw std::runtime_error(strprintf("SQLiteDatabase: Failed to close database: %s\n", sqlite3_errstr(res)));
167+
}
168+
m_db = nullptr;
164169
}
165170

166171
std::unique_ptr<DatabaseBatch> SQLiteDatabase::MakeBatch(bool flush_on_close)

0 commit comments

Comments
 (0)