mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Implement SQLiteBatch::Close
This commit is contained in:
parent
93825352a3
commit
6636a2608a
1 changed files with 8 additions and 0 deletions
|
@ -182,6 +182,14 @@ SQLiteBatch::SQLiteBatch(SQLiteDatabase& database)
|
|||
|
||||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue