| 447 | } |
| 448 | |
| 449 | bool 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 | |
| 474 | bool invoices_delete_description(struct invoices *invoices, u64 inv_dbid, |
| 475 | const struct json_escape *label, |
nothing calls this directly
no test coverage detected