| 24 | #define ONCHAIN_FEE "onchain_fee" |
| 25 | |
| 26 | static struct income_event *chain_to_income(const tal_t *ctx, |
| 27 | const struct bkpr *bkpr, |
| 28 | struct chain_event *ev, |
| 29 | const char *acct_to_attribute, |
| 30 | struct amount_msat credit, |
| 31 | struct amount_msat debit) |
| 32 | { |
| 33 | struct income_event *inc = tal(ctx, struct income_event); |
| 34 | |
| 35 | inc->acct_name = tal_strdup(inc, acct_to_attribute); |
| 36 | inc->tag = tal_strdup(inc, ev->tag); |
| 37 | inc->credit = credit; |
| 38 | inc->debit = debit; |
| 39 | inc->fees = AMOUNT_MSAT(0); |
| 40 | inc->timestamp = ev->timestamp; |
| 41 | inc->outpoint = tal_dup(inc, struct bitcoin_outpoint, &ev->outpoint); |
| 42 | inc->desc = tal_strdup_or_null(inc, chain_event_description(bkpr, ev)); |
| 43 | inc->txid = tal_dup_or_null(inc, struct bitcoin_txid, ev->spending_txid); |
| 44 | inc->payment_id = tal_dup_or_null(inc, struct sha256, ev->payment_id); |
| 45 | |
| 46 | return inc; |
| 47 | } |
| 48 | |
| 49 | static struct income_event *channel_to_income(const tal_t *ctx, |
| 50 | const struct bkpr *bkpr, |
no test coverage detected