Skip to content

Commit

Permalink
fixed issue in is_witness_scriptpubkey where self[0] is interpretted …
Browse files Browse the repository at this point in the history
…as str instead of the necessary int
  • Loading branch information
Surya Bakshi authored and Bob McElrath committed Feb 2, 2017
1 parent 2b50596 commit 5cd3467
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bitcoin/core/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def is_p2sh(self):
def is_witness_scriptpubkey(self):
"""Returns true if this is a scriptpubkey signaling segregated witness
data. """
return 3 <= len(self) <= 42 and CScriptOp(self[0]).is_small_int()
return 3 <= len(self) <= 42 and CScriptOp(struct.unpack('<b',self[0])[0]).is_small_int()

def witness_version(self):
"""Returns the witness version on [0,16]. """
Expand Down

0 comments on commit 5cd3467

Please sign in to comment.