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

Function invoice_get_status

wallet/invoices.c:511–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511static enum invoice_status invoice_get_status(struct invoices *invoices, struct invoice invoice)
512{
513 struct db_stmt *stmt;
514 enum invoice_status state;
515 bool res;
516
517 stmt = db_prepare_v2(
518 invoices->db, SQL("SELECT state FROM invoices WHERE id = ?;"));
519 db_bind_u64(stmt, 0, invoice.id);
520 db_query_prepared(stmt);
521
522 res = db_step(stmt);
523 assert(res);
524 state = db_col_int(stmt, "state");
525 tal_free(stmt);
526 return state;
527}
528
529/* If there's an associated offer, mark it used. */
530static void maybe_mark_offer_used(struct db *db, struct invoice invoice)

Callers 2

invoices_resolveFunction · 0.85
invoices_waitoneFunction · 0.85

Calls 5

db_bind_u64Function · 0.85
db_query_preparedFunction · 0.85
db_stepFunction · 0.85
db_col_intFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected