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

Function scriptpubkey_to_remote

onchaind/onchaind.c:2089–2113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2087}
2088
2089static u8 *scriptpubkey_to_remote(const tal_t *ctx,
2090 const struct pubkey *remotekey,
2091 u32 csv_lock)
2092{
2093 /* BOLT #3:
2094 *
2095 * #### `to_remote` Output
2096 *
2097 * If `option_anchors` applies to the commitment
2098 * transaction, the `to_remote` output is encumbered by a one
2099 * block csv lock.
2100 * <remotepubkey> OP_CHECKSIGVERIFY 1 OP_CHECKSEQUENCEVERIFY
2101 *
2102 *...
2103 * Otherwise, this output is a simple P2WPKH to `remotepubkey`.
2104 */
2105 if (option_anchor_outputs || option_anchors_zero_fee_htlc_tx) {
2106 return scriptpubkey_p2wsh(ctx,
2107 bitcoin_wscript_to_remote_anchored(tmpctx,
2108 remotekey,
2109 csv_lock));
2110 } else {
2111 return scriptpubkey_p2wpkh(ctx, remotekey);
2112 }
2113}
2114
2115static void our_unilateral_to_us(struct tracked_output ***outs,
2116 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