Skip to content

Commit fab1af3

Browse files
author
MarcoFalke
committed
[qa] maxuploadtarget: Use cached utxo set
1 parent fa2ecc4 commit fab1af3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

qa/rpc-tests/maxuploadtarget.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ def __init__(self):
8686
self.setup_clean_chain = True
8787
self.num_nodes = 1
8888

89+
# Cache for utxos, as the listunspent may take a long time later in the test
90+
self.utxo_cache = []
91+
8992
def setup_network(self):
9093
# Start a node with maxuploadtarget of 200 MB (/24h)
9194
self.nodes = []
@@ -118,7 +121,7 @@ def run_test(self):
118121
# Test logic begins here
119122

120123
# Now mine a big block
121-
mine_large_block(self.nodes[0])
124+
mine_large_block(self.nodes[0], self.utxo_cache)
122125

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

131134
# Mine one more block, so that the prior block looks old
132-
mine_large_block(self.nodes[0])
135+
mine_large_block(self.nodes[0], self.utxo_cache)
133136

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

0 commit comments

Comments
 (0)