| 86 | } |
| 87 | |
| 88 | static struct command_result *tell_waiter(struct command *cmd, |
| 89 | const struct invoice *inv) |
| 90 | { |
| 91 | struct json_stream *response; |
| 92 | const struct invoice_details *details; |
| 93 | |
| 94 | details = wallet_invoice_details(cmd, cmd->ld->wallet, *inv); |
| 95 | if (details->state == PAID) { |
| 96 | response = json_stream_success(cmd); |
| 97 | json_add_invoice_fields(response, details); |
| 98 | return command_success(cmd, response); |
| 99 | } else { |
| 100 | response = json_stream_fail(cmd, INVOICE_EXPIRED_DURING_WAIT, |
| 101 | "invoice expired during wait"); |
| 102 | json_add_invoice_fields(response, details); |
| 103 | json_object_end(response); |
| 104 | return command_failed(cmd, response); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | static void tell_waiter_deleted(struct command *cmd) |
| 109 | { |
no test coverage detected