Skip to content

Commit 2d113fb

Browse files
committed
Merge rust-bitcoin/rust-miniscript#472: Fix pk_len() for BareCtx
f3ae0d8 Fix `pk_len()` for `BareCtx` (Alekos Filini) Pull request description: 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. ------ This PR is based on the `7.0.0` tag because in my opinion it's worth applying this and releasing as `7.0.1` without waiting for `8.0.0` (BDK would naturally benefit from this because we are about to make one new release still based on `7.0.0` and it's tricky to workaround this issue in our code). I think the patch is small enough that it can easily be applied on older releases as well, if you want to backport it too. ACKs for top commit: evanlinjin: ACK f3ae0d8 sanket1729: ACK f3ae0d8 apoelstra: ACK f3ae0d8 Tree-SHA512: cc01c3a14708e081592b0a01d61ab7800ff5175047ef0b7315f56c898d84119270e5f680bb0de1d0997b4108be02af7d5896bab7c8cef8f053c99c979db9bf8b
2 parents 2f1535e + f3ae0d8 commit 2d113fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/miniscript/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,9 +768,9 @@ impl ScriptContext for BareCtx {
768768

769769
fn pk_len<Pk: MiniscriptKey>(pk: &Pk) -> usize {
770770
if pk.is_uncompressed() {
771-
65
771+
66
772772
} else {
773-
33
773+
34
774774
}
775775
}
776776

0 commit comments

Comments
 (0)