mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
script: add helper to use a raw witness program.
This is for future compatibility. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
9ec5cb7ba2
commit
20ce829f81
@ -319,6 +319,15 @@ u8 *scriptpubkey_p2wpkh_derkey(const tal_t *ctx, const u8 der[33])
|
||||
return script;
|
||||
}
|
||||
|
||||
u8 *scriptpubkey_witness_raw(const tal_t *ctx, u8 version,
|
||||
const u8 *wprog, size_t wprog_size)
|
||||
{
|
||||
u8 *script = tal_arr(ctx, u8, 0);
|
||||
add_number(&script, version);
|
||||
add_push_bytes(&script, wprog, wprog_size);
|
||||
return script;
|
||||
}
|
||||
|
||||
/* Create a witness which spends the 2of2. */
|
||||
u8 **bitcoin_witness_2of2(const tal_t *ctx,
|
||||
const secp256k1_ecdsa_signature *sig1,
|
||||
|
@ -57,6 +57,10 @@ u8 *scriptpubkey_p2wpkh(const tal_t *ctx, const struct pubkey *key);
|
||||
/* Same as above, but compressed key is already DER-encoded. */
|
||||
u8 *scriptpubkey_p2wpkh_derkey(const tal_t *ctx, const u8 der[33]);
|
||||
|
||||
/* Encode an arbitrary witness as <version> <push:wprog> */
|
||||
u8 *scriptpubkey_witness_raw(const tal_t *ctx, u8 version,
|
||||
const u8 *wprog, size_t wprog_size);
|
||||
|
||||
/* Create a witness which spends the 2of2. */
|
||||
u8 **bitcoin_witness_2of2(const tal_t *ctx,
|
||||
const secp256k1_ecdsa_signature *sig1,
|
||||
|
Loading…
Reference in New Issue
Block a user