| 96 | } |
| 97 | |
| 98 | static struct command_result *tell_waiter(struct command *cmd, u64 inv_dbid) |
| 99 | { |
| 100 | struct json_stream *response; |
| 101 | const struct invoice_details *details; |
| 102 | |
| 103 | details = invoices_get_details(cmd, cmd->ld->wallet->invoices, inv_dbid); |
| 104 | if (details->state == PAID) { |
| 105 | response = json_stream_success(cmd); |
| 106 | json_add_invoice_fields(response, details); |
| 107 | return command_success(cmd, response); |
| 108 | } else { |
| 109 | response = json_stream_fail(cmd, INVOICE_EXPIRED_DURING_WAIT, |
| 110 | "invoice expired during wait"); |
| 111 | json_add_invoice_fields(response, details); |
| 112 | json_object_end(response); |
| 113 | return command_failed(cmd, response); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | static void tell_waiter_deleted(struct command *cmd) |
| 118 | { |
no test coverage detected