Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/sqlite.cpp
Show First 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | std::unique_ptr<DatabaseBatch> SQLiteDatabase::MakeBatch(bool flush_on_close) { | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
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); | ||||
} | } | ||||
void SQLiteBatch::Close() {} | void SQLiteBatch::Close() { | ||||
// If m_db is in a transaction (i.e. not in autocommit mode), then abort the | |||||
// transaction in progress | |||||
if (m_database.m_db && sqlite3_get_autocommit(m_database.m_db) == 0) { | |||||
if (TxnAbort()) { | |||||
LogPrintf("SQLiteBatch: Batch closed unexpectedly without the " | |||||
"transaction being explicitly committed or aborted\n"); | |||||
} else { | |||||
LogPrintf( | |||||
"SQLiteBatch: Batch closed and failed to abort transaction\n"); | |||||
} | |||||
} | |||||
} | |||||
bool SQLiteBatch::ReadKey(CDataStream &&key, CDataStream &value) { | bool SQLiteBatch::ReadKey(CDataStream &&key, CDataStream &value) { | ||||
return false; | return false; | ||||
} | } | ||||
bool SQLiteBatch::WriteKey(CDataStream &&key, CDataStream &&value, | bool SQLiteBatch::WriteKey(CDataStream &&key, CDataStream &&value, | ||||
bool overwrite) { | bool overwrite) { | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |