@@ -265,18 +265,12 @@ static const char *fmt_route(const tal_t *ctx,
265265 return str ;
266266}
267267
268- static const char * fmt_flow_full (const tal_t * ctx ,
269- const struct route_query * rq ,
270- const struct flow * flow ,
271- struct amount_msat total_delivered ,
272- double delay_feefactor )
268+ const char * fmt_flow_full (const tal_t * ctx ,
269+ const struct route_query * rq ,
270+ const struct flow * flow )
273271{
274272 struct amount_msat amt = flow -> delivers ;
275- char * str = tal_fmt (ctx , "%s (linear cost %s)" ,
276- fmt_amount_msat (tmpctx , amt ),
277- fmt_amount_msat (tmpctx , linear_flow_cost (flow ,
278- total_delivered ,
279- delay_feefactor )));
273+ char * str = fmt_amount_msat (ctx , flow -> delivers );
280274
281275 for (int i = tal_count (flow -> path ) - 1 ; i >= 0 ; i -- ) {
282276 struct short_channel_id_dir scidd ;
@@ -471,15 +465,21 @@ static const char *get_routes(const tal_t *ctx,
471465 fmt_amount_msat (tmpctx , old_cost ));
472466 for (size_t i = 0 ; i < tal_count (flows ); i ++ ) {
473467 rq_log (tmpctx , rq , LOG_BROKEN ,
474- "Flow %zu/%zu: %s" , i , tal_count (flows ),
475- fmt_flow_full (tmpctx , rq , flows [i ], amount , delay_feefactor ));
468+ "Flow %zu/%zu: %s (linear cost %s)" , i , tal_count (flows ),
469+ fmt_flow_full (tmpctx , rq , flows [i ]),
470+ fmt_amount_msat (tmpctx , linear_flow_cost (flows [i ],
471+ amount ,
472+ delay_feefactor )));
476473 }
477474 rq_log (tmpctx , rq , LOG_BROKEN , "Old flows cost %s:" ,
478475 fmt_amount_msat (tmpctx , new_cost ));
479476 for (size_t i = 0 ; i < tal_count (new_flows ); i ++ ) {
480477 rq_log (tmpctx , rq , LOG_BROKEN ,
481- "Flow %zu/%zu: %s" , i , tal_count (new_flows ),
482- fmt_flow_full (tmpctx , rq , new_flows [i ], amount , delay_feefactor ));
478+ "Flow %zu/%zu: %s (linear cost %s)" , i , tal_count (new_flows ),
479+ fmt_flow_full (tmpctx , rq , new_flows [i ]),
480+ fmt_amount_msat (tmpctx , linear_flow_cost (new_flows [i ],
481+ amount ,
482+ delay_feefactor )));
483483 }
484484 }
485485 }
0 commit comments