1325@@ -1326,8 +1326,8 @@ def add_transactions_to_block(self, block, tx_list):
1326 block.vtx.extend(tx_list)
1327
1328 # this is a little handier to use than the version in blocktools.py
1329- def create_tx(self, spend_tx, n, value, script=CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])):
1330- return create_tx_with_script(spend_tx, n, amount=value, script_pub_key=script)
1331+ def create_tx(self, spend_tx, n, value, output_script=None):
1332+ return create_tx_with_script(spend_tx, n, amount=value, output_script=CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE]) if output_script is None else output_script)
slight preference for this pattern unless I’m missing a subtlety
0 if output_script is None:
1 output_script = CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])
2 return create_tx_with_script(spend_tx, n, amount=value, output_script=output_script)
Agree, this is more flexible if the arg is used more than once. Also, the code is less crammed.