2022-07-19 09:34:35 +02:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <ccan/tal/str/str.h>
|
|
|
|
#include <plugins/bkpr/account_entry.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
static const char *tags[] = {
|
|
|
|
"journal_entry",
|
2022-07-19 09:34:36 +02:00
|
|
|
"penalty_adj",
|
2022-07-19 09:34:38 +02:00
|
|
|
"invoice_fee",
|
bkpr: track channel rebalances, display in listincome
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
2022-07-31 23:55:58 +02:00
|
|
|
"rebalance_fee",
|
2022-07-19 09:34:35 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|