Skip to content

Commit

Permalink
[qa] maxuploadtarget: Use cached utxo set
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Dec 4, 2016
1 parent fa2ecc4 commit fab1af3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions qa/rpc-tests/maxuploadtarget.py
Expand Up @@ -86,6 +86,9 @@ def __init__(self):
self.setup_clean_chain = True
self.num_nodes = 1

# Cache for utxos, as the listunspent may take a long time later in the test
self.utxo_cache = []

def setup_network(self):
# Start a node with maxuploadtarget of 200 MB (/24h)
self.nodes = []
Expand Down Expand Up @@ -118,7 +121,7 @@ def run_test(self):
# Test logic begins here

# Now mine a big block
mine_large_block(self.nodes[0])
mine_large_block(self.nodes[0], self.utxo_cache)

# Store the hash; we'll request this later
big_old_block = self.nodes[0].getbestblockhash()
Expand All @@ -129,7 +132,7 @@ def run_test(self):
self.nodes[0].setmocktime(int(time.time()) - 2*60*60*24)

# Mine one more block, so that the prior block looks old
mine_large_block(self.nodes[0])
mine_large_block(self.nodes[0], self.utxo_cache)

# We'll be requesting this new block too
big_new_block = self.nodes[0].getbestblockhash()
Expand Down

0 comments on commit fab1af3

Please sign in to comment.