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

Function invoices_delete

wallet/invoices.c:403–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401}
402
403bool invoices_delete(struct invoices *invoices, struct invoice invoice)
404{
405 struct db_stmt *stmt;
406 int changes;
407 /* Delete from database. */
408 stmt = db_prepare_v2(invoices->db,
409 SQL("DELETE FROM invoices WHERE id=?;"));
410 db_bind_u64(stmt, 0, invoice.id);
411 db_exec_prepared_v2(stmt);
412
413 changes = db_count_changes(stmt);
414 tal_free(stmt);
415
416 if (changes != 1) {
417 return false;
418 }
419 /* Tell all the waiters about the fact that it was deleted. */
420 trigger_invoice_waiter_expire_or_delete(invoices, invoice.id, NULL);
421 return true;
422}
423
424bool invoices_delete_description(struct invoices *invoices, struct invoice invoice)
425{

Callers 1

wallet_invoice_deleteFunction · 0.70

Calls 5

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

Tested by

no test coverage detected