diff options
author | MarcoFalke <falke.marco@gmail.com> | 2016-12-06 12:05:31 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2016-12-06 12:08:27 +0100 |
commit | 919db037f1f5cc73cdcaef92dd9cb0e7f5c8dec3 (patch) | |
tree | 8a13af0f51314109b43e714b7e301dfb89189de5 /qa/rpc-tests/test_framework/util.py | |
parent | ed8d693c71b01caa310922f883b3915c09bb6a35 (diff) | |
parent | fab1af31d43f0db58f590992d1cc5e302f1133f8 (diff) |
Merge #9274: [qa] Use cached utxo set to fix performance regression
fab1af3 [qa] maxuploadtarget: Use cached utxo set (MarcoFalke)
fa2ecc4 [qa] pruning: Use cached utxo set to run faster (MarcoFalke)
Diffstat (limited to 'qa/rpc-tests/test_framework/util.py')
-rw-r--r-- | qa/rpc-tests/test_framework/util.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py index 1d6c9aa230..85898d9f32 100644 --- a/qa/rpc-tests/test_framework/util.py +++ b/qa/rpc-tests/test_framework/util.py @@ -654,10 +654,10 @@ def create_tx(node, coinbase, to_address, amount): # Create a spend of each passed-in utxo, splicing in "txouts" to each raw # transaction to make it large. See gen_return_txouts() above. -def create_lots_of_big_transactions(node, txouts, utxos, fee): +def create_lots_of_big_transactions(node, txouts, utxos, num, fee): addr = node.getnewaddress() txids = [] - for _ in range(len(utxos)): + for _ in range(num): t = utxos.pop() inputs=[{ "txid" : t["txid"], "vout" : t["vout"]}] outputs = {} @@ -672,13 +672,17 @@ def create_lots_of_big_transactions(node, txouts, utxos, fee): txids.append(txid) return txids -def mine_large_block(node): +def mine_large_block(node, utxos=None): # generate a 66k transaction, # and 14 of them is close to the 1MB block limit + num = 14 txouts = gen_return_txouts() - utxos = node.listunspent()[:14] + utxos = utxos if utxos is not None else [] + if len(utxos) < num: + utxos.clear() + utxos.extend(node.listunspent()) fee = 100 * node.getnetworkinfo()["relayfee"] - create_lots_of_big_transactions(node, txouts, utxos, fee=fee) + create_lots_of_big_transactions(node, txouts, utxos, num, fee=fee) node.generate(1) def get_bip9_status(node, key): |