MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / make_scripts

Function make_scripts

examples/publish-text.py:121–135  ·  view source on GitHub ↗
(lines, n)

Source from the content-addressed store, hash-verified

119scripts = []
120while 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)):

Callers 1

publish-text.pyFile · 0.85

Calls 2

Hash160Function · 0.85
CScriptClass · 0.85

Tested by

no test coverage detected