|
1 | 1 | /* Routines to get suitable pay_flow array from pay constraints */ |
2 | 2 | #include "config.h" |
3 | | -#include <ccan/json_out/json_out.h> |
4 | 3 | #include <ccan/tal/str/str.h> |
5 | 4 | #include <common/gossmap.h> |
6 | 5 | #include <common/pseudorand.h> |
@@ -548,71 +547,6 @@ const char *flow_path_to_str(const tal_t *ctx, const struct pay_flow *flow) |
548 | 547 | return s; |
549 | 548 | } |
550 | 549 |
|
551 | | -const char* fmt_payflows(const tal_t *ctx, |
552 | | - struct pay_flow ** flows) |
553 | | -{ |
554 | | - struct json_out *jout = json_out_new(ctx); |
555 | | - json_out_start(jout, NULL, '{'); |
556 | | - json_out_start(jout,"Pay_flows",'['); |
557 | | - |
558 | | - for(size_t i=0;i<tal_count(flows);++i) |
559 | | - { |
560 | | - struct pay_flow *f = flows[i]; |
561 | | - json_out_start(jout,NULL,'{'); |
562 | | - |
563 | | - json_out_add(jout,"success_prob",false,"%.2lf",f->success_prob); |
564 | | - |
565 | | - json_out_start(jout,"path_scids",'['); |
566 | | - for(size_t j=0;j<tal_count(f->path_scids);++j) |
567 | | - { |
568 | | - json_out_add(jout,NULL,true,"%s", |
569 | | - type_to_string(ctx,struct short_channel_id,&f->path_scids[j])); |
570 | | - } |
571 | | - json_out_end(jout,']'); |
572 | | - |
573 | | - json_out_start(jout,"path_dirs",'['); |
574 | | - for(size_t j=0;j<tal_count(f->path_dirs);++j) |
575 | | - { |
576 | | - json_out_add(jout,NULL,false,"%d",f->path_dirs[j]); |
577 | | - } |
578 | | - json_out_end(jout,']'); |
579 | | - |
580 | | - json_out_start(jout,"amounts",'['); |
581 | | - for(size_t j=0;j<tal_count(f->amounts);++j) |
582 | | - { |
583 | | - json_out_add(jout,NULL,true,"%s", |
584 | | - type_to_string(ctx,struct amount_msat,&f->amounts[j])); |
585 | | - } |
586 | | - json_out_end(jout,']'); |
587 | | - |
588 | | - json_out_start(jout,"cltv_delays",'['); |
589 | | - for(size_t j=0;j<tal_count(f->cltv_delays);++j) |
590 | | - { |
591 | | - json_out_add(jout,NULL,false,"%d",f->cltv_delays[j]); |
592 | | - } |
593 | | - json_out_end(jout,']'); |
594 | | - |
595 | | - json_out_start(jout,"path_nodes",'['); |
596 | | - for(size_t j=0;j<tal_count(f->path_nodes);++j) |
597 | | - { |
598 | | - json_out_add(jout,NULL,true,"%s", |
599 | | - type_to_string(ctx,struct node_id,&f->path_nodes[j])); |
600 | | - } |
601 | | - json_out_end(jout,']'); |
602 | | - |
603 | | - json_out_end(jout,'}'); |
604 | | - } |
605 | | - |
606 | | - json_out_end(jout,']'); |
607 | | - json_out_end(jout, '}'); |
608 | | - json_out_direct(jout, 1)[0] = '\n'; |
609 | | - json_out_direct(jout, 1)[0] = '\0'; |
610 | | - json_out_finished(jout); |
611 | | - |
612 | | - size_t len; |
613 | | - return json_out_contents(jout,&len); |
614 | | -} |
615 | | - |
616 | 550 | /* How much does this flow deliver to destination? */ |
617 | 551 | struct amount_msat payflow_delivered(const struct pay_flow *flow) |
618 | 552 | { |
|
0 commit comments