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

Function scriptpubkey_to_remote

onchaind/onchaind.c:2112–2136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2110}
2111
2112static u8 *scriptpubkey_to_remote(const tal_t *ctx,
2113 const struct pubkey *remotekey,
2114 u32 csv_lock)
2115{
2116 /* BOLT #3:
2117 *
2118 * #### `to_remote` Output
2119 *
2120 * If `option_anchors` applies to the commitment
2121 * transaction, the `to_remote` output is encumbered by a one
2122 * block csv lock.
2123 * <remotepubkey> OP_CHECKSIGVERIFY 1 OP_CHECKSEQUENCEVERIFY
2124 *
2125 *...
2126 * Otherwise, this output is a simple P2WPKH to `remotepubkey`.
2127 */
2128 if (option_anchor_outputs || option_anchors_zero_fee_htlc_tx) {
2129 return scriptpubkey_p2wsh(ctx,
2130 bitcoin_wscript_to_remote_anchored(tmpctx,
2131 remotekey,
2132 csv_lock));
2133 } else {
2134 return scriptpubkey_p2wpkh(ctx, remotekey);
2135 }
2136}
2137
2138static void our_unilateral_to_us(struct tracked_output ***outs,
2139 const struct bitcoin_outpoint *outpoint,

Callers 4

handle_our_unilateralFunction · 0.85
handle_their_cheatFunction · 0.85
handle_their_unilateralFunction · 0.85

Calls 3

scriptpubkey_p2wshFunction · 0.85
scriptpubkey_p2wpkhFunction · 0.85

Tested by

no test coverage detected