MCPcopy Create free account
hub / github.com/ElementsProject/lightning / db_commit_transaction

Function db_commit_transaction

db/exec.c:159–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159void db_commit_transaction(struct db *db)
160{
161 bool ok;
162 assert(db->in_transaction);
163
164 if (!db->transaction_started) {
165 db->in_transaction = NULL;
166 assert(!db->dirty);
167 return;
168 }
169
170 db_assert_no_outstanding_statements(db);
171
172 /* Increment before reporting changes to an eventual plugin. */
173 if (db->dirty)
174 db_data_version_incr(db);
175
176 db_report_changes(db, NULL, 0);
177 ok = db->config->commit_tx_fn(db);
178
179 if (!ok)
180 db_fatal(db, "Failed to commit DB transaction: %s", db->error);
181
182 db->in_transaction = NULL;
183 db->dirty = false;
184 db->transaction_started = false;
185}

Callers 15

prepare_table_manipFunction · 0.70
complete_table_manipFunction · 0.70
db_get_versionFunction · 0.70
mainFunction · 0.50
migrate_from_account_dbFunction · 0.50
db_setupFunction · 0.50
wallet_newFunction · 0.50
test_empty_db_migrateFunction · 0.50
test_primitivesFunction · 0.50
test_varsFunction · 0.50
test_manip_columnsFunction · 0.50
create_test_walletFunction · 0.50

Calls 4

db_data_version_incrFunction · 0.85
db_report_changesFunction · 0.85
db_fatalFunction · 0.85

Tested by 15

test_empty_db_migrateFunction · 0.40
test_primitivesFunction · 0.40
test_varsFunction · 0.40
test_manip_columnsFunction · 0.40
create_test_walletFunction · 0.40
test_wallet_outputsFunction · 0.40
test_shachain_crudFunction · 0.40
test_channel_crudFunction · 0.40
test_htlc_crudFunction · 0.40
test_payment_crudFunction · 0.40
mainFunction · 0.40