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:
Christian Decker 2019-10-14 21:45:29 +02:00 committed by neil saitug
parent 2ab56214ca
commit 894627a287
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}