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

Function payment_rpc_failure

plugins/renepay/mods.c:76–93  ·  view source on GitHub ↗

Generic handler for RPC failures that should end up failing the payment. */

Source from the content-addressed store, hash-verified

74
75/* Generic handler for RPC failures that should end up failing the payment. */
76static struct command_result *payment_rpc_failure(struct command *cmd,
77 const char *method UNUSED,
78 const char *buffer,
79 const jsmntok_t *toks,
80 struct payment *payment)
81{
82 const jsmntok_t *codetok = json_get_member(buffer, toks, "code");
83 u32 errcode;
84 if (codetok != NULL)
85 json_to_u32(buffer, codetok, &errcode);
86 else
87 errcode = LIGHTNINGD;
88
89 return payment_fail(
90 payment, errcode,
91 "Failing a partial payment due to a failed RPC call: %.*s",
92 json_tok_full_len(toks), json_tok_full(buffer, toks));
93}
94
95static void add_hintchan(struct payment *payment, const struct node_id *src,
96 const struct node_id *dst, u16 cltv_expiry_delta,

Callers

nothing calls this directly

Calls 5

json_get_memberFunction · 0.85
payment_failFunction · 0.70
json_to_u32Function · 0.50
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50

Tested by

no test coverage detected