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

Function scriptpubkey_to_remote

onchaind/onchaind.c:2259–2283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2257}
2258
2259static u8 *scriptpubkey_to_remote(const tal_t *ctx,
2260 const struct pubkey *remotekey,
2261 u32 csv_lock)
2262{
2263 /* BOLT #3:
2264 *
2265 * #### `to_remote` Output
2266 *
2267 * If `option_anchors` applies to the commitment
2268 * transaction, the `to_remote` output is encumbered by a one
2269 * block csv lock.
2270 * <remotepubkey> OP_CHECKSIGVERIFY 1 OP_CHECKSEQUENCEVERIFY
2271 *
2272 *...
2273 * Otherwise, this output is a simple P2WPKH to `remotepubkey`.
2274 */
2275 if (option_anchor_outputs || option_anchors_zero_fee_htlc_tx) {
2276 return scriptpubkey_p2wsh(ctx,
2277 bitcoin_wscript_to_remote_anchored(tmpctx,
2278 remotekey,
2279 csv_lock));
2280 } else {
2281 return scriptpubkey_p2wpkh(ctx, remotekey);
2282 }
2283}
2284
2285static void our_unilateral_to_us(struct tracked_output ***outs,
2286 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