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

Function tx_add_anchor_output

common/initial_commit_tx.c:61–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

commit_txFunction · 0.85
initial_commit_txFunction · 0.85

Calls 3

bitcoin_wscript_anchorFunction · 0.85
bitcoin_tx_add_outputFunction · 0.85
scriptpubkey_p2wshFunction · 0.50

Tested by

no test coverage detected