Skip to content

Commit

Permalink
Implement SQLiteDatabase::Close
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Oct 14, 2020
1 parent a0de833 commit 9382535
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wallet/sqlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<DatabaseBatch> SQLiteDatabase::MakeBatch(bool flush_on_close)
Expand Down

0 comments on commit 9382535

Please sign in to comment.