| 60 | } |
| 61 | |
| 62 | static struct income_event *channel_to_income(const tal_t *ctx, |
| 63 | struct channel_event *ev, |
| 64 | struct amount_msat credit, |
| 65 | struct amount_msat debit) |
| 66 | { |
| 67 | struct income_event *inc = tal(ctx, struct income_event); |
| 68 | |
| 69 | inc->acct_name = tal_strdup(inc, ev->acct_name); |
| 70 | inc->tag = tal_strdup(inc, ev->tag); |
| 71 | inc->credit = credit; |
| 72 | inc->debit = debit; |
| 73 | inc->fees = ev->fees; |
| 74 | inc->currency = tal_strdup(inc, ev->currency); |
| 75 | inc->timestamp = ev->timestamp; |
| 76 | inc->outpoint = NULL; |
| 77 | inc->txid = NULL; |
| 78 | if (ev->desc) |
| 79 | inc->desc = tal_strdup(inc, ev->desc); |
| 80 | else |
| 81 | inc->desc = NULL; |
| 82 | inc->payment_id = tal_dup_or_null(inc, struct sha256, ev->payment_id); |
| 83 | |
| 84 | return inc; |
| 85 | } |
| 86 | |
| 87 | static struct income_event *onchainfee_to_income(const tal_t *ctx, |
| 88 | struct onchain_fee *fee) |
no outgoing calls
no test coverage detected