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

Function migrate_initialize_invoice_wait_indexes

wallet/db.c:717–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715}
716
717void migrate_initialize_invoice_wait_indexes(struct lightningd *ld,
718 struct db *db)
719{
720 struct db_stmt *stmt;
721 bool res;
722
723 /* "invoices.id" serves as the created_index. It's never 0. */
724 stmt = db_prepare_v2(db, SQL("SELECT MAX(id) FROM invoices;"));
725 db_query_prepared(stmt);
726 res = db_step(stmt);
727 assert(res);
728
729 if (!db_col_is_null(stmt, "MAX(id)"))
730 db_set_intvar(db, "last_invoice_created_index",
731 db_col_u64(stmt, "MAX(id)"));
732 tal_free(stmt);
733}
734
735void migrate_invoice_created_index_var(struct lightningd *ld, struct db *db)
736{

Callers

nothing calls this directly

Calls 6

db_query_preparedFunction · 0.85
db_stepFunction · 0.85
db_col_is_nullFunction · 0.85
db_set_intvarFunction · 0.85
db_col_u64Function · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected