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

Function preapproveinvoice_succeed

plugins/pay.c:841–867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

839}
840
841static struct command_result *
842preapproveinvoice_succeed(struct command *cmd,
843 const char *method,
844 const char *buf,
845 const jsmntok_t *result,
846 struct payment *p)
847{
848 /* Now we can conclude `check` command */
849 if (command_check_only(cmd)) {
850 return command_check_done(cmd);
851 }
852
853 /* Blinded path which starts at us needs decryption. */
854 if (p->blindedpath && node_id_eq(p->route_destination, &my_id)) {
855 struct out_req *req;
856
857 req = jsonrpc_request_start(cmd, "decryptencrypteddata",
858 decrypt_done, forward_error, p);
859
860 json_add_hex_talarr(req->js, "encrypted_data",
861 p->blindedpath->path[0]->encrypted_recipient_data);
862 json_add_pubkey(req->js, "path_key", &p->blindedpath->first_path_key);
863 return send_outreq(req);
864 }
865
866 return start_payment(cmd, p);
867}
868static struct command_result *json_pay(struct command *cmd,
869 const char *buf,
870 const jsmntok_t *params)

Callers

nothing calls this directly

Calls 7

node_id_eqFunction · 0.85
json_add_hex_talarrFunction · 0.85
json_add_pubkeyFunction · 0.85
start_paymentFunction · 0.85
command_check_onlyFunction · 0.70
command_check_doneFunction · 0.70
send_outreqFunction · 0.70

Tested by

no test coverage detected