Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/sqlite.cpp
Show First 20 Lines • Show All 320 Lines • ▼ Show 20 Lines | if (res != SQLITE_OK) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
strprintf("SQLiteDatabase: Failed to close database: %s\n", | strprintf("SQLiteDatabase: Failed to close database: %s\n", | ||||
sqlite3_errstr(res))); | sqlite3_errstr(res))); | ||||
} | } | ||||
m_db = nullptr; | m_db = nullptr; | ||||
} | } | ||||
std::unique_ptr<DatabaseBatch> SQLiteDatabase::MakeBatch(bool flush_on_close) { | std::unique_ptr<DatabaseBatch> SQLiteDatabase::MakeBatch(bool flush_on_close) { | ||||
return nullptr; | // We ignore flush_on_close because we don't do manual flushing for SQLite | ||||
return std::make_unique<SQLiteBatch>(*this); | |||||
} | } | ||||
SQLiteBatch::SQLiteBatch(SQLiteDatabase &database) : m_database(database) { | SQLiteBatch::SQLiteBatch(SQLiteDatabase &database) : m_database(database) { | ||||
// Make sure we have a db handle | // Make sure we have a db handle | ||||
assert(m_database.m_db); | assert(m_database.m_db); | ||||
SetupSQLStatements(); | SetupSQLStatements(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 291 Lines • Show Last 20 Lines |