mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-29 07:18:58 +01:00
test: Fix intermittent failure in feature_dbcrash
This commit is contained in:
@@ -256,7 +256,11 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
|
|||||||
self.log.debug("Mining longer tip")
|
self.log.debug("Mining longer tip")
|
||||||
block_hashes = []
|
block_hashes = []
|
||||||
while current_height + 1 > self.nodes[3].getblockcount():
|
while current_height + 1 > self.nodes[3].getblockcount():
|
||||||
block_hashes.extend(self.nodes[3].generate(min(10, current_height + 1 - self.nodes[3].getblockcount())))
|
block_hashes.extend(self.nodes[3].generatetoaddress(
|
||||||
|
nblocks=min(10, current_height + 1 - self.nodes[3].getblockcount()),
|
||||||
|
# new address to avoid mining a block that has just been invalidated
|
||||||
|
address=self.nodes[3].getnewaddress(),
|
||||||
|
))
|
||||||
self.log.debug("Syncing %d new blocks...", len(block_hashes))
|
self.log.debug("Syncing %d new blocks...", len(block_hashes))
|
||||||
self.sync_node3blocks(block_hashes)
|
self.sync_node3blocks(block_hashes)
|
||||||
utxo_list = self.nodes[3].listunspent()
|
utxo_list = self.nodes[3].listunspent()
|
||||||
@@ -281,5 +285,6 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
|
|||||||
if self.restart_counts[i] == 0:
|
if self.restart_counts[i] == 0:
|
||||||
self.log.warning("Node %d never crashed during utxo flush!", i)
|
self.log.warning("Node %d never crashed during utxo flush!", i)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
ChainstateWriteCrashTest().main()
|
ChainstateWriteCrashTest().main()
|
||||||
|
|||||||
Reference in New Issue
Block a user