(lines, n)
| 119 | scripts = [] |
| 120 | while padded_lines: |
| 121 | def make_scripts(lines, n): |
| 122 | # The n makes sure every p2sh addr is unique; the pubkey lets us |
| 123 | # control the order the vin order vs. just using hashlocks. |
| 124 | redeemScript = [] |
| 125 | for chunk in reversed(lines): |
| 126 | if len(chunk) > MAX_SCRIPT_ELEMENT_SIZE: |
| 127 | parser.exit('Lines must be less than %d characters; got %d characters' %\ |
| 128 | (MAX_SCRIPT_ELEMENT_SIZE, len(chunk))) |
| 129 | redeemScript.extend([OP_HASH160, Hash160(chunk), OP_EQUALVERIFY]) |
| 130 | redeemScript = CScript(redeemScript + |
| 131 | [args.privkey.pub, OP_CHECKSIGVERIFY, |
| 132 | n, OP_DROP, # deduplicate push dropped to meet BIP62 rules |
| 133 | OP_DEPTH, 0, OP_EQUAL]) # prevent scriptSig malleability |
| 134 | |
| 135 | return CScript(lines) + redeemScript, redeemScript |
| 136 | |
| 137 | scriptSig = redeemScript = None |
| 138 | for i in range(len(padded_lines)): |
no test coverage detected