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

Function json_sendpay_fail_fields

lightningd/pay.c:207–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207void json_sendpay_fail_fields(struct json_stream *js,
208 const struct wallet_payment *payment,
209 enum jsonrpc_errcode pay_errcode,
210 const struct onionreply *onionreply,
211 const struct routing_failure *fail)
212{
213 /* "immediate_routing_failure" is before payment creation. */
214 if (payment)
215 json_add_payment_fields(js, payment);
216 if (pay_errcode == PAY_UNPARSEABLE_ONION && onionreply)
217 json_add_hex_talarr(js, "onionreply", onionreply->contents);
218 else if (fail)
219 json_add_routefail_info(js,
220 fail->erring_index,
221 fail->failcode,
222 fail->erring_node,
223 fail->erring_channel,
224 fail->channel_dir,
225 fail->msg);
226}
227
228static const char *sendpay_errmsg_fmt(const tal_t *ctx, enum jsonrpc_errcode pay_errcode,
229 const struct routing_failure *fail,

Callers 2

sendpay_failFunction · 0.85

Calls 3

json_add_payment_fieldsFunction · 0.85
json_add_routefail_infoFunction · 0.85
json_add_hex_talarrFunction · 0.50

Tested by

no test coverage detected