| 288 | } |
| 289 | |
| 290 | static struct command_result *my_command_finish(struct payment *p, |
| 291 | struct command *cmd) |
| 292 | { |
| 293 | struct json_stream *result; |
| 294 | if (p->status == PAYMENT_SUCCESS) { |
| 295 | result = jsonrpc_stream_success(cmd); |
| 296 | json_add_payment(result, p); |
| 297 | return command_finished(cmd, result); |
| 298 | } |
| 299 | assert(p->status == PAYMENT_FAIL); |
| 300 | assert(p->error_msg); |
| 301 | return command_fail(cmd, p->error_code, "%s", p->error_msg); |
| 302 | } |
| 303 | |
| 304 | static struct command_result *payment_finish(struct payment *p) |
| 305 | { |
no test coverage detected