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

Function do_dump_income

plugins/bkpr/bookkeeper.c:443–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441};
442
443static struct command_result *do_dump_income(struct command *cmd,
444 struct dump_income_info *info)
445{
446 struct bkpr *bkpr = bkpr_of(cmd->plugin);
447 struct json_stream *res;
448 struct income_event **evs;
449 char *err;
450
451 /* Ok, go find me some income events! */
452 evs = list_income_events(cmd, bkpr, cmd, *info->start_time, *info->end_time,
453 *info->consolidate_fees);
454
455 if (!info->filename)
456 info->filename = csv_filename(info, info->csv_fmt);
457
458 err = csv_print_income_events(cmd, info->csv_fmt, info->filename, evs);
459 if (err)
460 return command_fail(cmd, PLUGIN_ERROR,
461 "Unable to create csv file: %s",
462 err);
463
464 res = jsonrpc_stream_success(cmd);
465 json_add_string(res, "csv_file", info->filename);
466 json_add_string(res, "csv_format", info->csv_fmt->fmt_name);
467 return command_finished(cmd, res);
468}
469
470static struct command_result *json_dump_income(struct command *cmd,
471 const char *buf,

Callers

nothing calls this directly

Calls 8

bkpr_ofFunction · 0.70
list_income_eventsFunction · 0.70
csv_filenameFunction · 0.70
csv_print_income_eventsFunction · 0.70
command_failFunction · 0.50
jsonrpc_stream_successFunction · 0.50
json_add_stringFunction · 0.50
command_finishedFunction · 0.50

Tested by

no test coverage detected