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

Function funding_tx

devtools/mkfunding.c:53–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53static struct bitcoin_tx *funding_tx(const tal_t *ctx,
54 const struct utxo *utxo,
55 struct amount_sat funding,
56 const struct pubkey *local_fundingkey,
57 const struct pubkey *remote_fundingkey)
58{
59 u8 *wscript;
60 struct bitcoin_tx *tx;
61
62 tx = tx_spending_utxo(ctx, utxo,
63 1, 0, BITCOIN_TX_DEFAULT_SEQUENCE);
64
65 wscript = bitcoin_redeem_2of2(tx, local_fundingkey, remote_fundingkey);
66 bitcoin_tx_add_output(tx, scriptpubkey_p2wsh(tx, wscript), wscript, funding);
67 tal_free(wscript);
68
69 bitcoin_tx_finalize(tx);
70 assert(bitcoin_tx_check(tx));
71 return tx;
72}
73
74int main(int argc, char *argv[])
75{

Callers 1

mainFunction · 0.85

Calls 7

tx_spending_utxoFunction · 0.85
bitcoin_redeem_2of2Function · 0.85
bitcoin_tx_add_outputFunction · 0.85
tal_freeFunction · 0.85
bitcoin_tx_finalizeFunction · 0.85
bitcoin_tx_checkFunction · 0.85
scriptpubkey_p2wshFunction · 0.50

Tested by

no test coverage detected