Create P2SH scriptPubKey from this redeemScript That is, create the P2SH scriptPubKey that requires this script as a redeemScript to spend. checksize - Check if the redeemScript is larger than the 520-byte max pushdata limit; raise ValueError if limit exceeded.
(self, checksize=True)
| 775 | return True |
| 776 | |
| 777 | def to_p2sh_scriptPubKey(self, checksize=True): |
| 778 | """Create P2SH scriptPubKey from this redeemScript |
| 779 | |
| 780 | That is, create the P2SH scriptPubKey that requires this script as a |
| 781 | redeemScript to spend. |
| 782 | |
| 783 | checksize - Check if the redeemScript is larger than the 520-byte max |
| 784 | pushdata limit; raise ValueError if limit exceeded. |
| 785 | |
| 786 | Since a >520-byte PUSHDATA makes EvalScript() fail, it's not actually |
| 787 | possible to redeem P2SH outputs with redeem scripts >520 bytes. |
| 788 | """ |
| 789 | if checksize and len(self) > MAX_SCRIPT_ELEMENT_SIZE: |
| 790 | raise ValueError("redeemScript exceeds max allowed size; P2SH output would be unspendable") |
| 791 | return CScript([OP_HASH160, bitcoin.core.Hash160(self), OP_EQUAL]) |
| 792 | |
| 793 | def GetSigOpCount(self, fAccurate): |
| 794 | """Get the SigOp count. |