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

Function describe_capacity

plugins/askrene/child/explain_failure.c:200–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200static const char *describe_capacity(const tal_t *ctx,
201 const struct route_query *rq,
202 const struct short_channel_id_dir *scidd,
203 struct amount_msat amount)
204{
205 for (int i = tal_count(rq->layers) - 1; i >= 0; i--) {
206 if (layer_created(rq->layers[i], scidd->scid)) {
207 return tal_fmt(ctx, " (created by layer %s) isn't big enough to carry %s.",
208 layer_name(rq->layers[i]),
209 fmt_amount_msat(tmpctx, amount));
210 }
211 }
212
213 return tal_fmt(ctx, "isn't big enough to carry %s.",
214 fmt_amount_msat(tmpctx, amount));
215}
216
217/* We failed to find a flow at all. Why? */
218const char *explain_failure(const tal_t *ctx,

Callers 1

explain_failureFunction · 0.85

Calls 3

layer_createdFunction · 0.85
layer_nameFunction · 0.85
fmt_amount_msatFunction · 0.50

Tested by

no test coverage detected