| 437 | } |
| 438 | |
| 439 | struct 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 | |
| 472 | struct chain_coin_mvt *new_coin_channel_open(const tal_t *ctx, |
| 473 | const struct channel *channel, |
no test coverage detected