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

Function db_report_changes

db/utils.c:230–243  ·  view source on GitHub ↗

We expect min changes (ie. BEGIN TRANSACTION): report if more. * Optionally add "final" at the end (ie. COMMIT). */

Source from the content-addressed store, hash-verified

228/* We expect min changes (ie. BEGIN TRANSACTION): report if more.
229 * Optionally add "final" at the end (ie. COMMIT). */
230void db_report_changes(struct db *db, const char *final, size_t min)
231{
232 assert(db->changes);
233 assert(tal_count(db->changes) >= min);
234
235 /* Having changes implies that we have a dirty TX. The opposite is
236 * currently not true, e.g., the postgres driver doesn't record
237 * changes yet. */
238 assert(!tal_count(db->changes) || db->dirty);
239
240 if (tal_count(db->changes) > min && db->report_changes_fn)
241 db->report_changes_fn(db);
242 db->changes = tal_free(db->changes);
243}
244
245void db_changes_add(struct db_stmt *stmt, const char * expanded)
246{

Callers 4

db_open_Function · 0.85
prepare_table_manipFunction · 0.85
complete_table_manipFunction · 0.85
db_commit_transactionFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected