mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-09 10:43:19 -05:00
[qa] maxuploadtarget: Use cached utxo set
This commit is contained in:
parent
fa2ecc48fb
commit
fab1af31d4
1 changed files with 5 additions and 2 deletions
|
@ -86,6 +86,9 @@ class MaxUploadTest(BitcoinTestFramework):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 1
|
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):
|
def setup_network(self):
|
||||||
# Start a node with maxuploadtarget of 200 MB (/24h)
|
# Start a node with maxuploadtarget of 200 MB (/24h)
|
||||||
self.nodes = []
|
self.nodes = []
|
||||||
|
@ -118,7 +121,7 @@ class MaxUploadTest(BitcoinTestFramework):
|
||||||
# Test logic begins here
|
# Test logic begins here
|
||||||
|
|
||||||
# Now mine a big block
|
# 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
|
# Store the hash; we'll request this later
|
||||||
big_old_block = self.nodes[0].getbestblockhash()
|
big_old_block = self.nodes[0].getbestblockhash()
|
||||||
|
@ -129,7 +132,7 @@ class MaxUploadTest(BitcoinTestFramework):
|
||||||
self.nodes[0].setmocktime(int(time.time()) - 2*60*60*24)
|
self.nodes[0].setmocktime(int(time.time()) - 2*60*60*24)
|
||||||
|
|
||||||
# Mine one more block, so that the prior block looks old
|
# 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
|
# We'll be requesting this new block too
|
||||||
big_new_block = self.nodes[0].getbestblockhash()
|
big_new_block = self.nodes[0].getbestblockhash()
|
||||||
|
|
Loading…
Add table
Reference in a new issue