From f3ae0d89f47c918ededb00a5f78115cff1aa85e6 Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Tue, 4 Oct 2022 16:37:47 +0200 Subject: [PATCH] Fix `pk_len()` for `BareCtx` The `pk_len()` returned should account for the extra byte for the OP_PUSH opcode. This is true for all the other contexts, but not for `BareCtx`, so this commit fixes it. --- src/miniscript/context.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/miniscript/context.rs b/src/miniscript/context.rs index 6e236e154..2ace85b5a 100644 --- a/src/miniscript/context.rs +++ b/src/miniscript/context.rs @@ -739,9 +739,9 @@ impl ScriptContext for BareCtx { fn pk_len(pk: &Pk) -> usize { if pk.is_uncompressed() { - 65 + 66 } else { - 33 + 34 } }