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

Function tx_add_anchor_output

common/initial_commit_tx.c:60–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60void tx_add_anchor_output(struct bitcoin_tx *tx,
61 const struct pubkey *funding_key)
62{
63 u8 *wscript = bitcoin_wscript_anchor(tmpctx, funding_key);
64 u8 *p2wsh = scriptpubkey_p2wsh(tmpctx, wscript);
65
66 /* BOLT #3:
67 * The amount of the output is fixed at 330 sats, the default
68 * dust limit for P2WSH.
69 */
70 bitcoin_tx_add_output(tx, p2wsh, wscript, AMOUNT_SAT(330));
71}
72
73struct bitcoin_tx *initial_commit_tx(const tal_t *ctx,
74 const struct bitcoin_outpoint *funding,

Callers 2

commit_txFunction · 0.85
initial_commit_txFunction · 0.85

Calls 3

bitcoin_wscript_anchorFunction · 0.85
scriptpubkey_p2wshFunction · 0.85
bitcoin_tx_add_outputFunction · 0.85

Tested by

no test coverage detected