File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
test/functional/test_framework Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -232,12 +232,14 @@ def create_self_transfer_multi(
232
232
* ,
233
233
utxos_to_spend : Optional [List [dict ]] = None ,
234
234
num_outputs = 1 ,
235
+ amount_per_output = 0 ,
235
236
sequence = 0 ,
236
237
fee_per_output = 1000 ,
237
238
):
238
239
"""
239
240
Create and return a transaction that spends the given UTXOs and creates a
240
- certain number of outputs with equal amounts.
241
+ certain number of outputs with equal amounts. The output amounts can be
242
+ set by amount_per_output or automatically calculated with a fee_per_output.
241
243
"""
242
244
utxos_to_spend = utxos_to_spend or [self .get_utxo ()]
243
245
# create simple tx template (1 input, 1 output)
@@ -258,7 +260,7 @@ def create_self_transfer_multi(
258
260
inputs_value_total = sum ([int (COIN * utxo ['value' ]) for utxo in utxos_to_spend ])
259
261
outputs_value_total = inputs_value_total - fee_per_output * num_outputs
260
262
for o in tx .vout :
261
- o .nValue = outputs_value_total // num_outputs
263
+ o .nValue = amount_per_output or ( outputs_value_total // num_outputs )
262
264
txid = tx .rehash ()
263
265
return {
264
266
"new_utxos" : [self ._create_utxo (
You can’t perform that action at this time.
0 commit comments