MCPcopy
hub / github.com/petertodd/python-bitcoinlib / is_valid

Method is_valid

bitcoin/core/script.py:765–775  ·  view source on GitHub ↗

Return True if the script is valid, False otherwise The script is valid if all PUSHDATA's are valid; invalid opcodes do not make is_valid() return False.

(self)

Source from the content-addressed store, hash-verified

763 self[0] == OP_RETURN)
764
765 def is_valid(self):
766 """Return True if the script is valid, False otherwise
767
768 The script is valid if all PUSHDATA's are valid; invalid opcodes do not
769 make is_valid() return False.
770 """
771 try:
772 list(self)
773 except CScriptInvalidError:
774 return False
775 return True
776
777 def to_p2sh_scriptPubKey(self, checksize=True):
778 """Create P2SH scriptPubKey from this redeemScript

Callers 1

TMethod · 0.95

Calls

no outgoing calls

Tested by 1

TMethod · 0.76