mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 08:34:20 +01:00
psbt: finalize to-remote with option_anchor_outputs.
Until it gains miniscript support, wally doesn't know how to finalize P2WSH. This happens with `option_anchor_outputs` for to-remote, which requires a 1 block delay to force use of anchor outputs for CPFP. So we finalize this ourselves. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -340,9 +340,25 @@ u8 *anchor_to_remote_redeem(const tal_t *ctx,
|
||||
add_number(&script, 1);
|
||||
add_op(&script, OP_CHECKSEQUENCEVERIFY);
|
||||
|
||||
assert(is_anchor_witness_script(script, tal_bytelen(script)));
|
||||
return script;
|
||||
}
|
||||
|
||||
bool is_anchor_witness_script(const u8 *script, size_t script_len)
|
||||
{
|
||||
if (script_len != 34 + 1 + 1 + 1)
|
||||
return false;
|
||||
if (script[0] != OP_PUSHBYTES(33))
|
||||
return false;
|
||||
if (script[34] != OP_CHECKSIGVERIFY)
|
||||
return false;
|
||||
if (script[35] != 0x51)
|
||||
return false;
|
||||
if (script[36] != OP_CHECKSEQUENCEVERIFY)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Create a witness which spends the 2of2. */
|
||||
u8 **bitcoin_witness_2of2(const tal_t *ctx,
|
||||
const struct bitcoin_signature *sig1,
|
||||
|
||||
Reference in New Issue
Block a user