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

Function new_coin_channel_open_general

common/coin_mvt.c:439–470  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439struct chain_coin_mvt *new_coin_channel_open_general(const tal_t *ctx,
440 const struct channel *channel,
441 const struct channel_id *cid,
442 u64 timestamp,
443 const struct bitcoin_outpoint *out,
444 const struct node_id *peer_id,
445 u32 blockheight,
446 const struct amount_msat amount,
447 const struct amount_sat output_val,
448 bool is_opener,
449 bool is_leased)
450{
451 struct chain_coin_mvt *mvt;
452 struct mvt_tags tags = tag_to_mvt_tags(MVT_CHANNEL_OPEN);
453
454 /* If we're the opener, add to the tag list */
455 if (is_opener)
456 mvt_tag_set(&tags, MVT_OPENER);
457
458 if (is_leased)
459 mvt_tag_set(&tags, MVT_LEASED);
460
461 mvt = new_chain_coin_mvt(ctx, channel, cid ? take(fmt_channel_id(NULL, cid)) : NULL,
462 timestamp,
463 NULL, out, NULL, blockheight,
464 tags,
465 COIN_CREDIT, amount,
466 output_val, 0);
467 mvt->peer_id = tal_dup(mvt, struct node_id, peer_id);
468
469 return mvt;
470}
471
472struct chain_coin_mvt *new_coin_channel_open(const tal_t *ctx,
473 const struct channel *channel,

Callers 2

migrate_setup_coinmovesFunction · 0.85
new_coin_channel_openFunction · 0.85

Calls 4

tag_to_mvt_tagsFunction · 0.85
mvt_tag_setFunction · 0.85
new_chain_coin_mvtFunction · 0.85
fmt_channel_idFunction · 0.70

Tested by

no test coverage detected