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

Function db_report_changes

db/utils.c:216–229  ·  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

214/* We expect min changes (ie. BEGIN TRANSACTION): report if more.
215 * Optionally add "final" at the end (ie. COMMIT). */
216void db_report_changes(struct db *db, const char *final, size_t min)
217{
218 assert(db->changes);
219 assert(tal_count(db->changes) >= min);
220
221 /* Having changes implies that we have a dirty TX. The opposite is
222 * currently not true, e.g., the postgres driver doesn't record
223 * changes yet. */
224 assert(!tal_count(db->changes) || db->dirty);
225
226 if (tal_count(db->changes) > min && db->report_changes_fn)
227 db->report_changes_fn(db);
228 db->changes = tal_free(db->changes);
229}
230
231void db_changes_add(struct db_stmt *stmt, const char * expanded)
232{

Callers 4

db_openFunction · 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