diff options
| author | Andrew Chow <[email protected]> | 2020-05-26 20:53:32 -0400 |
|---|---|---|
| committer | Andrew Chow <[email protected]> | 2020-10-14 11:28:18 -0400 |
| commit | 93825352a36456283bf87e39b5888363ee242f21 (patch) | |
| tree | 800785b07ae73308a7810ea760e0f4fc51b88e60 /src/wallet/sqlite.cpp | |
| parent | Implement SQLiteDatabase::Open (diff) | |
| download | discoin-93825352a36456283bf87e39b5888363ee242f21.tar.xz discoin-93825352a36456283bf87e39b5888363ee242f21.zip | |
Implement SQLiteDatabase::Close
Diffstat (limited to 'src/wallet/sqlite.cpp')
| -rw-r--r-- | src/wallet/sqlite.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/sqlite.cpp b/src/wallet/sqlite.cpp index fb0bef14e..7d96575a6 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<DatabaseBatch> SQLiteDatabase::MakeBatch(bool flush_on_close) |