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

Function scriptpubkey_to_remote

onchaind/onchaind.c:2557–2581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2555}
2556
2557static u8 *scriptpubkey_to_remote(const tal_t *ctx,
2558 const struct pubkey *remotekey,
2559 u32 csv_lock)
2560{
2561 /* BOLT #3:
2562 *
2563 * #### `to_remote` Output
2564 *
2565 * If `option_anchors` applies to the commitment
2566 * transaction, the `to_remote` output is encumbered by a one
2567 * block csv lock.
2568 * <remotepubkey> OP_CHECKSIGVERIFY 1 OP_CHECKSEQUENCEVERIFY
2569 *
2570 *...
2571 * Otherwise, this output is a simple P2WPKH to `remotepubkey`.
2572 */
2573 if (option_anchor_outputs) {
2574 return scriptpubkey_p2wsh(ctx,
2575 anchor_to_remote_redeem(tmpctx,
2576 remotekey,
2577 csv_lock));
2578 } else {
2579 return scriptpubkey_p2wpkh(ctx, remotekey);
2580 }
2581}
2582
2583static void our_unilateral_to_us(struct tracked_output ***outs,
2584 const struct bitcoin_outpoint *outpoint,

Callers 4

handle_our_unilateralFunction · 0.85
handle_their_cheatFunction · 0.85
handle_their_unilateralFunction · 0.85

Calls 3

anchor_to_remote_redeemFunction · 0.85
scriptpubkey_p2wpkhFunction · 0.85
scriptpubkey_p2wshFunction · 0.50

Tested by

no test coverage detected