@@ -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 ;
@@ -465,15 +459,21 @@ static const char *get_routes(const tal_t *ctx,
465459 fmt_amount_msat (tmpctx , old_cost ));
466460 for (size_t i = 0 ; i < tal_count (flows ); i ++ ) {
467461 rq_log (tmpctx , rq , LOG_BROKEN ,
468- "Flow %zu/%zu: %s" , i , tal_count (flows ),
469- fmt_flow_full (tmpctx , rq , flows [i ], amount , delay_feefactor ));
462+ "Flow %zu/%zu: %s (linear cost %s)" , i , tal_count (flows ),
463+ fmt_flow_full (tmpctx , rq , flows [i ]),
464+ fmt_amount_msat (tmpctx , linear_flow_cost (flows [i ],
465+ amount ,
466+ delay_feefactor )));
470467 }
471468 rq_log (tmpctx , rq , LOG_BROKEN , "Old flows cost %s:" ,
472469 fmt_amount_msat (tmpctx , new_cost ));
473470 for (size_t i = 0 ; i < tal_count (new_flows ); i ++ ) {
474471 rq_log (tmpctx , rq , LOG_BROKEN ,
475- "Flow %zu/%zu: %s" , i , tal_count (new_flows ),
476- fmt_flow_full (tmpctx , rq , new_flows [i ], amount , delay_feefactor ));
472+ "Flow %zu/%zu: %s (linear cost %s)" , i , tal_count (new_flows ),
473+ fmt_flow_full (tmpctx , rq , new_flows [i ]),
474+ fmt_amount_msat (tmpctx , linear_flow_cost (new_flows [i ],
475+ amount ,
476+ delay_feefactor )));
477477 }
478478 }
479479 }
0 commit comments