mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-11 10:04:28 +01:00
db: Fix report and commit order for DB transactions
Reported-by: Simon Vrouwe <@SimonVrouwe> Signed-off-by: Christian Decker <@cdecker>
This commit is contained in:
committed by
neil saitug
parent
2ab56214ca
commit
894627a287
@@ -658,12 +658,12 @@ void db_commit_transaction(struct db *db)
|
||||
bool ok;
|
||||
assert(db->in_transaction);
|
||||
db_assert_no_outstanding_statements(db);
|
||||
db_report_changes(db, NULL, 0);
|
||||
ok = db->config->commit_tx_fn(db);
|
||||
|
||||
if (!ok)
|
||||
db_fatal("Failed to commit DB transaction: %s", db->error);
|
||||
|
||||
db_report_changes(db, NULL, 0);
|
||||
db->in_transaction = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user