Returns whether this follows the OP_HASH160 <20 byte hash> OP_EQUAL pattern.
(self)
| 255 | and self.cmds[3] == 0x88 and self.cmds[4] == 0xac |
| 256 | |
| 257 | def is_p2sh_script_pubkey(self): |
| 258 | '''Returns whether this follows the |
| 259 | OP_HASH160 <20 byte hash> OP_EQUAL pattern.''' |
| 260 | # there should be exactly 3 cmds |
| 261 | # OP_HASH160 (0xa9), 20-byte hash, OP_EQUAL (0x87) |
| 262 | return len(self.cmds) == 3 and self.cmds[0] == 0xa9 \ |
| 263 | and type(self.cmds[1]) == bytes and len(self.cmds[1]) == 20 \ |
| 264 | and self.cmds[2] == 0x87 |
| 265 | |
| 266 | # tag::source2[] |
| 267 | def is_p2wpkh_script_pubkey(self): # <2> |
no outgoing calls
no test coverage detected