| 401 | } |
| 402 | |
| 403 | bool 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 | |
| 424 | bool invoices_delete_description(struct invoices *invoices, struct invoice invoice) |
| 425 | { |
no test coverage detected