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

Function json_add_routefail_info

lightningd/pay.c:205–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205static void
206json_add_routefail_info(struct json_stream *js,
207 unsigned int erring_index,
208 enum onion_wire failcode,
209 const struct node_id *erring_node,
210 const struct short_channel_id *erring_channel,
211 int channel_dir,
212 const u8 *msg)
213{
214 const char *failcodename = onion_wire_name(failcode);
215
216 json_add_num(js, "erring_index", erring_index);
217 json_add_num(js, "failcode", failcode);
218 /* FIXME: Better way to detect this? */
219 if (!strstarts(failcodename, "UNKNOWN "))
220 json_add_string(js, "failcodename", failcodename);
221
222 if (erring_node != NULL)
223 json_add_node_id(js, "erring_node", erring_node);
224
225 if (erring_channel != NULL) {
226 json_add_short_channel_id(js, "erring_channel", *erring_channel);
227 json_add_num(js, "erring_direction", channel_dir);
228 }
229
230 if (msg)
231 json_add_hex_talarr(js, "raw_message", msg);
232}
233
234void json_sendpay_fail_fields(struct json_stream *js,
235 const struct wallet_payment *payment,

Callers 2

json_sendpay_fail_fieldsFunction · 0.85
send_payment_coreFunction · 0.85

Calls 5

json_add_numFunction · 0.85
json_add_node_idFunction · 0.85
json_add_hex_talarrFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected