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

Function chain_to_income

plugins/bkpr/incomestmt.c:26–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#define ONCHAIN_FEE "onchain_fee"
25
26static 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
49static struct income_event *channel_to_income(const tal_t *ctx,
50 const struct bkpr *bkpr,

Callers 1

maybe_chain_incomeFunction · 0.85

Calls 2

tal_strdup_or_nullFunction · 0.85
chain_event_descriptionFunction · 0.70

Tested by

no test coverage detected