Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/blocktools.py
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | for i in range(iterations): | ||||
outputs[addr2] = satoshi_round(t['amount'] / 2) | outputs[addr2] = satoshi_round(t['amount'] / 2) | ||||
raw_tx = node.createrawtransaction(inputs, outputs) | raw_tx = node.createrawtransaction(inputs, outputs) | ||||
ctx = FromHex(CTransaction(), raw_tx) | ctx = FromHex(CTransaction(), raw_tx) | ||||
fee = node.calculate_fee(ctx) // 2 | fee = node.calculate_fee(ctx) // 2 | ||||
ctx.vout[0].nValue -= fee | ctx.vout[0].nValue -= fee | ||||
# Due to possible truncation, we go ahead and take another satoshi in | # Due to possible truncation, we go ahead and take another satoshi in | ||||
# fees to ensure the transaction gets through | # fees to ensure the transaction gets through | ||||
ctx.vout[1].nValue -= fee + 1 | ctx.vout[1].nValue -= fee + 1 | ||||
signed_tx = node.signrawtransaction(ToHex(ctx))["hex"] | signed_tx = node.signrawtransactionwithwallet(ToHex(ctx))["hex"] | ||||
node.sendrawtransaction(signed_tx) | node.sendrawtransaction(signed_tx) | ||||
while (node.getmempoolinfo()['size'] > 0): | while (node.getmempoolinfo()['size'] > 0): | ||||
node.generate(1) | node.generate(1) | ||||
utxos = node.listunspent() | utxos = node.listunspent() | ||||
assert(len(utxos) >= count) | assert(len(utxos) >= count) | ||||
return utxos | return utxos | ||||
Show All 37 Lines |