| 453 | } |
| 454 | |
| 455 | static struct command_result *selfpay_success(struct command *cmd, |
| 456 | const char *method, |
| 457 | const char *buf, |
| 458 | const jsmntok_t *result, |
| 459 | struct payment *p) |
| 460 | { |
| 461 | struct json_stream *ret = jsonrpc_stream_success(cmd); |
| 462 | struct preimage preimage; |
| 463 | const char *err; |
| 464 | |
| 465 | err = json_scan(tmpctx, buf, result, |
| 466 | "{payment_preimage:%}", |
| 467 | JSON_SCAN(json_to_preimage, &preimage)); |
| 468 | if (err) |
| 469 | plugin_err(p->plugin, |
| 470 | "selfpay didn't have payment_preimage? %.*s", |
| 471 | json_tok_full_len(result), |
| 472 | json_tok_full(buf, result)); |
| 473 | json_add_payment_success(ret, p, &preimage, NULL); |
| 474 | return command_finished(cmd, ret); |
| 475 | } |
| 476 | |
| 477 | static struct command_result *selfpay(struct command *cmd, struct payment *p) |
| 478 | { |
nothing calls this directly
no test coverage detected