Skip to content

Commit 763e728

Browse files
committed
Merge #177: fix checking on p2sh-p2wsh
96dd697 fix checking on p2sh-p2wsh (Wan Wenli) Pull request description: After discussing in [this issue](#176), I think it is better to keep the methods signatures, but change the comments and fix a potential bug. Top commit has no ACKs. Tree-SHA512: 4f09f111903280d68a33394f64e02943bf9bdf287ec4bac470c5efabb334baddd3202b5e0fbad1ab4c9ccaca9325580d38881c60285a1adbc827281273ac1dc1
2 parents 2e5a7c9 + 96dd697 commit 763e728

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bitcoin/core/script.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,16 +705,16 @@ def is_witness_v0_keyhash(self):
705705
return len(self) == 22 and self[0:2] == b'\x00\x14'
706706

707707
def is_witness_v0_nested_keyhash(self):
708-
"""Returns true if this is a scriptpubkey for V0 P2WPKH embedded in P2SH. """
708+
"""Returns true if this is a scriptSig for V0 P2WPKH embedded in P2SH. """
709709
return len(self) == 23 and self[0:3] == b'\x16\x00\x14'
710710

711711
def is_witness_v0_scripthash(self):
712712
"""Returns true if this is a scriptpubkey for V0 P2WSH. """
713713
return len(self) == 34 and self[0:2] == b'\x00\x20'
714714

715715
def is_witness_v0_nested_scripthash(self):
716-
"""Returns true if this is a scriptpubkey for V0 P2WSH embedded in P2SH. """
717-
return len(self) == 23 and self[0:2] == b'\xa9\x14' and self[-1] == b'\x87'
716+
"""Returns true if this is a scriptSig for V0 P2WSH embedded in P2SH. """
717+
return len(self) == 35 and self[0:3] == b'\x22\x00\x20'
718718

719719
def is_push_only(self):
720720
"""Test if the script only contains pushdata ops

0 commit comments

Comments
 (0)