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

Function channel_size

openingd/dualopend.c:3410–3425  ·  view source on GitHub ↗

FIXME: Maybe cache this? */

Source from the content-addressed store, hash-verified

3408
3409/* FIXME: Maybe cache this? */
3410static struct amount_sat channel_size(struct state *state)
3411{
3412 u32 funding_outnum;
3413 const u8 *funding_wscript =
3414 bitcoin_redeem_2of2(tmpctx,
3415 &state->our_funding_pubkey,
3416 &state->their_funding_pubkey);
3417
3418 if (!find_txout(state->tx_state->psbt,
3419 scriptpubkey_p2wsh(tmpctx, funding_wscript),
3420 &funding_outnum)) {
3421 open_err_fatal(state, "Cannot fund txout");
3422 }
3423
3424 return psbt_output_get_amount(state->tx_state->psbt, funding_outnum);
3425}
3426
3427static void tell_gossipd_new_channel(struct state *state)
3428{

Callers 1

tell_gossipd_new_channelFunction · 0.85

Calls 5

bitcoin_redeem_2of2Function · 0.85
find_txoutFunction · 0.85
open_err_fatalFunction · 0.85
psbt_output_get_amountFunction · 0.85
scriptpubkey_p2wshFunction · 0.50

Tested by

no test coverage detected