mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
3fcf60ab7c
Track rebalances, and report income events for them. Previously `listincome` would report: - invoice event, debit, outgoing channel - invoice_fee event, debit, outgoing channel - invoice event, credit, inbound channel Now reports: - rebalance_fee, debit, outgoing channel (same value as invoice_fee above) Note: only applies on channel events; if a rebalance falls to chain we'll use the older style of accounting. Changelog-None
30 lines
533 B
C
30 lines
533 B
C
#include "config.h"
|
|
|
|
#include <ccan/tal/str/str.h>
|
|
#include <plugins/bkpr/account_entry.h>
|
|
#include <stddef.h>
|
|
|
|
static const char *tags[] = {
|
|
"journal_entry",
|
|
"penalty_adj",
|
|
"invoice_fee",
|
|
"rebalance_fee",
|
|
};
|
|
|
|
const char *account_entry_tag_str(enum account_entry_tag tag)
|
|
{
|
|
return tags[tag];
|
|
}
|
|
|
|
bool account_entry_tag_find(char *str, enum account_entry_tag *tag)
|
|
{
|
|
for (size_t i = 0; i < NUM_ACCOUNT_ENTRY_TAGS; i++) {
|
|
if (streq(str, tags[i])) {
|
|
*tag = (enum account_entry_tag) i;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|