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

Function describe_disabled

plugins/askrene/child/explain_failure.c:178–198  ·  view source on GitHub ↗

Return description of why scidd is disabled scidd */

Source from the content-addressed store, hash-verified

176
177/* Return description of why scidd is disabled scidd */
178static const char *describe_disabled(const tal_t *ctx,
179 const struct route_query *rq,
180 const struct gossmap_chan *c,
181 const struct short_channel_id_dir *scidd)
182{
183 for (int i = tal_count(rq->layers) - 1; i >= 0; i--) {
184 struct gossmap_node *dst = gossmap_nth_node(rq->gossmap, c, !scidd->dir);
185 struct node_id dstid;
186
187 gossmap_node_get_id(rq->gossmap, dst, &dstid);
188 if (layer_disables_node(rq->layers[i], &dstid))
189 return tal_fmt(ctx, "leads to node disabled by layer %s.",
190 layer_name(rq->layers[i]));
191 else if (layer_disables_chan(rq->layers[i], scidd)) {
192 return tal_fmt(ctx, "marked disabled by layer %s.",
193 layer_name(rq->layers[i]));
194 }
195 }
196
197 return tal_fmt(ctx, "marked disabled by gossip message.");
198}
199
200static const char *describe_capacity(const tal_t *ctx,
201 const struct route_query *rq,

Callers 1

explain_failureFunction · 0.85

Calls 5

gossmap_nth_nodeFunction · 0.85
gossmap_node_get_idFunction · 0.85
layer_disables_nodeFunction · 0.85
layer_nameFunction · 0.85
layer_disables_chanFunction · 0.85

Tested by

no test coverage detected