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

Method is_p2sh

bitcoin/core/script.py:663–671  ·  view source on GitHub ↗

Test if the script is a p2sh scriptPubKey Note that this test is consensus-critical.

(self)

Source from the content-addressed store, hash-verified

661 return "CScript([%s])" % ', '.join(ops)
662
663 def is_p2sh(self):
664 """Test if the script is a p2sh scriptPubKey
665
666 Note that this test is consensus-critical.
667 """
668 return (len(self) == 23 and
669 self[0] == OP_HASH160 and
670 self[1] == 0x14 and
671 self[22] == OP_EQUAL)
672
673 def is_witness_scriptpubkey(self):
674 """Returns true if this is a scriptpubkey signaling segregated witness data.

Callers 3

TMethod · 0.95
from_scriptPubKeyMethod · 0.80
VerifyScriptFunction · 0.80

Calls

no outgoing calls

Tested by 1

TMethod · 0.76