MCPcopy Create free account
hub / github.com/ElementsProject/lightning / do_bkpr_report

Function do_bkpr_report

plugins/bkpr/report.c:474–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474struct command_result *do_bkpr_report(struct command *cmd,
475 struct report_info *info)
476{
477 const struct bkpr *bkpr = bkpr_of(cmd->plugin);
478 struct income_event **events;
479 struct json_stream *js;
480
481 events = list_income_events(tmpctx, bkpr, cmd,
482 *info->start_time,
483 *info->end_time,
484 true);
485
486 js = jsonrpc_stream_success(cmd);
487 json_array_start(js, "report");
488 for (size_t i = 0; i < tal_count(info->headers); i++)
489 json_add_string(js, NULL, info->headers[i]);
490 for (size_t i = 0; i < tal_count(events); i++) {
491 char *line;
492
493 line = format_event(tmpctx, info->format, *info->escapes,
494 bkpr, events[i]);
495 json_add_string(js, NULL, line);
496 }
497 json_array_end(js);
498 /* Tell cli this is simple enough to be formatted flat for humans */
499 json_add_string(js, "format-hint", "simple");
500 return command_finished(cmd, js);
501}

Callers

nothing calls this directly

Calls 8

json_array_startFunction · 0.85
format_eventFunction · 0.85
json_array_endFunction · 0.85
bkpr_ofFunction · 0.70
list_income_eventsFunction · 0.70
jsonrpc_stream_successFunction · 0.50
json_add_stringFunction · 0.50
command_finishedFunction · 0.50

Tested by

no test coverage detected