bkpr: add a 'consolidate-fees' flag to the income stmt

Defaults to true. This is actually what you want to see -- the fees for
an account's txid collapsed into a single entry.
This commit is contained in:
niftynei
2022-07-19 17:04:37 +09:30
committed by Rusty Russell
parent 83c6cf25d2
commit a7b7ea5d49
6 changed files with 111 additions and 33 deletions

View File

@@ -44,14 +44,17 @@ static struct command_result *json_list_income(struct command *cmd,
{
struct json_stream *res;
struct income_event **evs;
bool *consolidate_fees;
if (!param(cmd, buf, params,
p_opt_def("consolidate_fees", param_bool,
&consolidate_fees, true),
NULL))
return command_param_failed();
/* Ok, go find me some income events! */
db_begin_transaction(db);
evs = list_income_events_all(cmd, db);
evs = list_income_events_all(cmd, db, *consolidate_fees);
db_commit_transaction(db);
res = jsonrpc_stream_success(cmd);