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

Function invoices_delete

wallet/invoices.c:449–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449bool invoices_delete(struct invoices *invoices, u64 inv_dbid,
450 enum invoice_status status,
451 const struct json_escape *label,
452 const char *invstring)
453{
454 struct db_stmt *stmt;
455 int changes;
456 /* Delete from database. */
457 stmt = db_prepare_v2(invoices->wallet->db,
458 SQL("DELETE FROM invoices WHERE id=?;"));
459 db_bind_u64(stmt, inv_dbid);
460 db_exec_prepared_v2(stmt);
461
462 changes = db_count_changes(stmt);
463 tal_free(stmt);
464
465 if (changes != 1) {
466 return false;
467 }
468 /* Tell all the waiters about the fact that it was deleted. */
469 invoice_index_deleted(invoices->wallet->ld, status, label, invstring);
470 trigger_invoice_waiter_expire_or_delete(invoices, inv_dbid, true);
471 return true;
472}
473
474bool invoices_delete_description(struct invoices *invoices, u64 inv_dbid,
475 const struct json_escape *label,

Callers

nothing calls this directly

Calls 6

db_bind_u64Function · 0.85
db_exec_prepared_v2Function · 0.85
db_count_changesFunction · 0.85
tal_freeFunction · 0.85
invoice_index_deletedFunction · 0.85

Tested by

no test coverage detected