mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-01 17:47:30 +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:
parent
2ab56214ca
commit
894627a287
1 changed files with 1 additions and 1 deletions
|
@ -658,12 +658,12 @@ void db_commit_transaction(struct db *db)
|
||||||
bool ok;
|
bool ok;
|
||||||
assert(db->in_transaction);
|
assert(db->in_transaction);
|
||||||
db_assert_no_outstanding_statements(db);
|
db_assert_no_outstanding_statements(db);
|
||||||
|
db_report_changes(db, NULL, 0);
|
||||||
ok = db->config->commit_tx_fn(db);
|
ok = db->config->commit_tx_fn(db);
|
||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
db_fatal("Failed to commit DB transaction: %s", db->error);
|
db_fatal("Failed to commit DB transaction: %s", db->error);
|
||||||
|
|
||||||
db_report_changes(db, NULL, 0);
|
|
||||||
db->in_transaction = NULL;
|
db->in_transaction = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue