From 395261fc304c85135ccf576842b7ad7f9c9cf229 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 16 Feb 2026 17:30:33 +1030 Subject: [PATCH] askrene: move fmt_flow_full from askrene.c into flow.c. Weird that it was in askrene.c Signed-off-by: Rusty Russell --- plugins/askrene/askrene.c | 28 ---------------------------- plugins/askrene/child/flow.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/plugins/askrene/askrene.c b/plugins/askrene/askrene.c index ff94b21ad..8a4c009d6 100644 --- a/plugins/askrene/askrene.c +++ b/plugins/askrene/askrene.c @@ -361,34 +361,6 @@ static const char *fmt_route(const tal_t *ctx, return str; } -const char *fmt_flow_full(const tal_t *ctx, - const struct route_query *rq, - const struct flow *flow) -{ - struct amount_msat amt = flow->delivers; - char *str = fmt_amount_msat(ctx, flow->delivers); - - for (int i = tal_count(flow->path) - 1; i >= 0; i--) { - struct short_channel_id_dir scidd; - struct amount_msat min, max; - scidd.scid = gossmap_chan_scid(rq->gossmap, flow->path[i]); - scidd.dir = flow->dirs[i]; - if (!amount_msat_add_fee(&amt, - flow->path[i]->half[scidd.dir].base_fee, - flow->path[i]->half[scidd.dir].proportional_fee)) - abort(); - get_constraints(rq, flow->path[i], scidd.dir, &min, &max); - tal_append_fmt(&str, " <- %s %s (cap=%s,fee=%u+%u,delay=%u)", - fmt_amount_msat(tmpctx, amt), - fmt_short_channel_id_dir(tmpctx, &scidd), - fmt_amount_msat(tmpctx, max), - flow->path[i]->half[scidd.dir].base_fee, - flow->path[i]->half[scidd.dir].proportional_fee, - flow->path[i]->half[scidd.dir].delay); - } - return str; -} - enum algorithm { /* Min. Cost Flow by successive shortests paths. */ ALGO_DEFAULT, diff --git a/plugins/askrene/child/flow.c b/plugins/askrene/child/flow.c index 2acd952a1..05d02680e 100644 --- a/plugins/askrene/child/flow.c +++ b/plugins/askrene/child/flow.c @@ -184,6 +184,34 @@ const char *fmt_flows_step_scid(const tal_t *ctx, return fmt_short_channel_id_dir(ctx, &scidd); } +const char *fmt_flow_full(const tal_t *ctx, + const struct route_query *rq, + const struct flow *flow) +{ + struct amount_msat amt = flow->delivers; + char *str = fmt_amount_msat(ctx, flow->delivers); + + for (int i = tal_count(flow->path) - 1; i >= 0; i--) { + struct short_channel_id_dir scidd; + struct amount_msat min, max; + scidd.scid = gossmap_chan_scid(rq->gossmap, flow->path[i]); + scidd.dir = flow->dirs[i]; + if (!amount_msat_add_fee(&amt, + flow->path[i]->half[scidd.dir].base_fee, + flow->path[i]->half[scidd.dir].proportional_fee)) + abort(); + get_constraints(rq, flow->path[i], scidd.dir, &min, &max); + tal_append_fmt(&str, " <- %s %s (cap=%s,fee=%u+%u,delay=%u)", + fmt_amount_msat(tmpctx, amt), + fmt_short_channel_id_dir(tmpctx, &scidd), + fmt_amount_msat(tmpctx, max), + flow->path[i]->half[scidd.dir].base_fee, + flow->path[i]->half[scidd.dir].proportional_fee, + flow->path[i]->half[scidd.dir].delay); + } + return str; +} + #ifndef SUPERVERBOSE_ENABLED #undef SUPERVERBOSE #endif