MCPcopy Create free account
hub / github.com/ElementsProject/lightning / channel_to_income

Function channel_to_income

plugins/bkpr/incomestmt.c:62–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62static 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
87static struct income_event *onchainfee_to_income(const tal_t *ctx,
88 struct onchain_fee *fee)

Callers 3

paid_invoice_feeFunction · 0.85
rebalance_feeFunction · 0.85
maybe_channel_incomeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected