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

Function json_add_routefail_info

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

Source from the content-addressed store, hash-verified

176}
177
178static void
179json_add_routefail_info(struct json_stream *js,
180 unsigned int erring_index,
181 enum onion_wire failcode,
182 const struct node_id *erring_node,
183 const struct short_channel_id *erring_channel,
184 int channel_dir,
185 const u8 *msg)
186{
187 const char *failcodename = onion_wire_name(failcode);
188
189 json_add_num(js, "erring_index", erring_index);
190 json_add_num(js, "failcode", failcode);
191 /* FIXME: Better way to detect this? */
192 if (!strstarts(failcodename, "INVALID "))
193 json_add_string(js, "failcodename", failcodename);
194
195 if (erring_node != NULL)
196 json_add_node_id(js, "erring_node", erring_node);
197
198 if (erring_channel != NULL) {
199 json_add_short_channel_id(js, "erring_channel", erring_channel);
200 json_add_num(js, "erring_direction", channel_dir);
201 }
202
203 if (msg)
204 json_add_hex_talarr(js, "raw_message", msg);
205}
206
207void json_sendpay_fail_fields(struct json_stream *js,
208 const struct wallet_payment *payment,

Callers 2

json_sendpay_fail_fieldsFunction · 0.85
send_payment_coreFunction · 0.85

Calls 6

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

Tested by

no test coverage detected