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

Function new_coin_channel_open

common/coin_mvt.c:227–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227struct chain_coin_mvt *new_coin_channel_open(const tal_t *ctx,
228 const struct channel_id *chan_id,
229 const struct bitcoin_outpoint *out,
230 const struct node_id *peer_id,
231 u32 blockheight,
232 const struct amount_msat amount,
233 const struct amount_sat output_val,
234 bool is_opener,
235 bool is_leased)
236{
237 struct chain_coin_mvt *mvt;
238
239 mvt = new_chain_coin_mvt(ctx, NULL, NULL, out, NULL, blockheight,
240 take(new_tag_arr(NULL, CHANNEL_OPEN)), amount,
241 true, output_val, 0);
242 mvt->account_name = type_to_string(mvt, struct channel_id, chan_id);
243 mvt->peer_id = tal_dup(mvt, struct node_id, peer_id);
244
245 /* If we're the opener, add to the tag list */
246 if (is_opener)
247 tal_arr_expand(&mvt->tags, OPENER);
248
249 if (is_leased)
250 tal_arr_expand(&mvt->tags, LEASED);
251
252 return mvt;
253}
254
255struct chain_coin_mvt *new_onchain_htlc_deposit(const tal_t *ctx,
256 const struct bitcoin_outpoint *outpoint,

Callers 1

channel_record_openFunction · 0.85

Calls 3

new_chain_coin_mvtFunction · 0.85
new_tag_arrFunction · 0.70
type_to_stringClass · 0.70

Tested by

no test coverage detected