diff --git a/plugins/renepay/pay_flow.c b/plugins/renepay/pay_flow.c index 100409831..ef56db3e7 100644 --- a/plugins/renepay/pay_flow.c +++ b/plugins/renepay/pay_flow.c @@ -1,6 +1,5 @@ /* Routines to get suitable pay_flow array from pay constraints */ #include "config.h" -#include <ccan/json_out/json_out.h> #include <ccan/tal/str/str.h> #include <common/gossmap.h> #include <common/pseudorand.h> @@ -548,71 +547,6 @@ const char *flow_path_to_str(const tal_t *ctx, const struct pay_flow *flow) return s; } -const char* fmt_payflows(const tal_t *ctx, - struct pay_flow ** flows) -{ - struct json_out *jout = json_out_new(ctx); - json_out_start(jout, NULL, '{'); - json_out_start(jout,"Pay_flows",'['); - - for(size_t i=0;i<tal_count(flows);++i) - { - struct pay_flow *f = flows[i]; - json_out_start(jout,NULL,'{'); - - json_out_add(jout,"success_prob",false,"%.2lf",f->success_prob); - - json_out_start(jout,"path_scids",'['); - for(size_t j=0;j<tal_count(f->path_scids);++j) - { - json_out_add(jout,NULL,true,"%s", - type_to_string(ctx,struct short_channel_id,&f->path_scids[j])); - } - json_out_end(jout,']'); - - json_out_start(jout,"path_dirs",'['); - for(size_t j=0;j<tal_count(f->path_dirs);++j) - { - json_out_add(jout,NULL,false,"%d",f->path_dirs[j]); - } - json_out_end(jout,']'); - - json_out_start(jout,"amounts",'['); - for(size_t j=0;j<tal_count(f->amounts);++j) - { - json_out_add(jout,NULL,true,"%s", - type_to_string(ctx,struct amount_msat,&f->amounts[j])); - } - json_out_end(jout,']'); - - json_out_start(jout,"cltv_delays",'['); - for(size_t j=0;j<tal_count(f->cltv_delays);++j) - { - json_out_add(jout,NULL,false,"%d",f->cltv_delays[j]); - } - json_out_end(jout,']'); - - json_out_start(jout,"path_nodes",'['); - for(size_t j=0;j<tal_count(f->path_nodes);++j) - { - json_out_add(jout,NULL,true,"%s", - type_to_string(ctx,struct node_id,&f->path_nodes[j])); - } - json_out_end(jout,']'); - - json_out_end(jout,'}'); - } - - json_out_end(jout,']'); - json_out_end(jout, '}'); - json_out_direct(jout, 1)[0] = '\n'; - json_out_direct(jout, 1)[0] = '\0'; - json_out_finished(jout); - - size_t len; - return json_out_contents(jout,&len); -} - /* How much does this flow deliver to destination? */ struct amount_msat payflow_delivered(const struct pay_flow *flow) { diff --git a/plugins/renepay/pay_flow.h b/plugins/renepay/pay_flow.h index 4756ad7a2..9e15a5cdd 100644 --- a/plugins/renepay/pay_flow.h +++ b/plugins/renepay/pay_flow.h @@ -134,9 +134,6 @@ struct pf_result *pay_flow_succeeded(struct pay_flow *pf STEALS, /* Formatting helpers */ const char *flow_path_to_str(const tal_t *ctx, const struct pay_flow *flow); -const char* fmt_payflows(const tal_t *ctx, - struct pay_flow ** flows); - /* How much does this flow deliver to destination? */ struct amount_msat payflow_delivered(const struct pay_flow *flow);