MCPcopy Create free account
hub / github.com/ElementsProject/lightning / selfpay_success

Function selfpay_success

plugins/pay.c:455–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455static 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
477static struct command_result *selfpay(struct command *cmd, struct payment *p)
478{

Callers

nothing calls this directly

Calls 7

json_add_payment_successFunction · 0.85
jsonrpc_stream_successFunction · 0.70
plugin_errFunction · 0.70
command_finishedFunction · 0.70
json_scanFunction · 0.50
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50

Tested by

no test coverage detected