We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9382535 commit 6636a26Copy full SHA for 6636a26
src/wallet/sqlite.cpp
@@ -182,6 +182,14 @@ SQLiteBatch::SQLiteBatch(SQLiteDatabase& database)
182
183
void SQLiteBatch::Close()
184
{
185
+ // If m_db is in a transaction (i.e. not in autocommit mode), then abort the transaction in progress
186
+ if (m_database.m_db && sqlite3_get_autocommit(m_database.m_db) == 0) {
187
+ if (TxnAbort()) {
188
+ LogPrintf("SQLiteBatch: Batch closed unexpectedly without the transaction being explicitly committed or aborted\n");
189
+ } else {
190
+ LogPrintf("SQLiteBatch: Batch closed and failed to abort transaction\n");
191
+ }
192
193
}
194
195
bool SQLiteBatch::ReadKey(CDataStream&& key, CDataStream& value)
0 commit comments