| 903 | return witness; |
| 904 | } |
| 905 | u8 *bitcoin_wscript_htlc_tx(const tal_t *ctx, |
| 906 | u16 to_self_delay, |
| 907 | const struct pubkey *revocation_pubkey, |
| 908 | const struct pubkey *local_delayedkey) |
| 909 | { |
| 910 | u8 *script = tal_arr(ctx, u8, 0); |
| 911 | |
| 912 | /* BOLT #3: |
| 913 | * |
| 914 | * The witness script for the output is: |
| 915 | * |
| 916 | * OP_IF |
| 917 | * # Penalty transaction |
| 918 | * <revocationpubkey> |
| 919 | * OP_ELSE |
| 920 | * `to_self_delay` |
| 921 | * OP_CHECKSEQUENCEVERIFY |
| 922 | * OP_DROP |
| 923 | * <local_delayedpubkey> |
| 924 | * OP_ENDIF |
| 925 | * OP_CHECKSIG |
| 926 | */ |
| 927 | add_op(&script, OP_IF); |
| 928 | add_push_key(&script, revocation_pubkey); |
| 929 | add_op(&script, OP_ELSE); |
| 930 | add_number(&script, to_self_delay); |
| 931 | add_op(&script, OP_CHECKSEQUENCEVERIFY); |
| 932 | add_op(&script, OP_DROP); |
| 933 | add_push_key(&script, local_delayedkey); |
| 934 | add_op(&script, OP_ENDIF); |
| 935 | add_op(&script, OP_CHECKSIG); |
| 936 | |
| 937 | return script; |
| 938 | } |
| 939 | |
| 940 | u8 *bitcoin_wscript_anchor(const tal_t *ctx, |
| 941 | const struct pubkey *funding_pubkey) |
no test coverage detected