mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
Implement SQLiteDatabase::Close
This commit is contained in:
parent
a0de83372b
commit
93825352a3
1 changed files with 5 additions and 0 deletions
|
@ -161,6 +161,11 @@ bool SQLiteDatabase::Backup(const std::string& dest) const
|
||||||
|
|
||||||
void SQLiteDatabase::Close()
|
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)
|
std::unique_ptr<DatabaseBatch> SQLiteDatabase::MakeBatch(bool flush_on_close)
|
||||||
|
|
Loading…
Add table
Reference in a new issue