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

Function json_sendpay_fail_fields

lightningd/pay.c:234–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234void json_sendpay_fail_fields(struct json_stream *js,
235 const struct wallet_payment *payment,
236 enum jsonrpc_errcode pay_errcode,
237 const struct onionreply *onionreply,
238 const struct routing_failure *fail)
239{
240 /* "immediate_routing_failure" is before payment creation. */
241 if (payment)
242 json_add_payment_fields(js, payment);
243 if (pay_errcode == PAY_UNPARSEABLE_ONION && onionreply)
244 json_add_hex_talarr(js, "onionreply", onionreply->contents);
245 else if (fail)
246 json_add_routefail_info(js,
247 fail->erring_index,
248 fail->failcode,
249 fail->erring_node,
250 fail->erring_channel,
251 fail->channel_dir,
252 fail->msg);
253}
254
255static const char *sendpay_errmsg_fmt(const tal_t *ctx, enum jsonrpc_errcode pay_errcode,
256 const struct routing_failure *fail,

Callers 2

sendpay_failFunction · 0.85

Calls 3

json_add_payment_fieldsFunction · 0.85
json_add_hex_talarrFunction · 0.85
json_add_routefail_infoFunction · 0.85

Tested by

no test coverage detected