diff --git a/test/functional/feature_dbcrash.py b/test/functional/feature_dbcrash.py --- a/test/functional/feature_dbcrash.py +++ b/test/functional/feature_dbcrash.py @@ -292,10 +292,14 @@ self.log.debug("Mining longer tip") block_hashes = [] while current_height + 1 > self.nodes[3].getblockcount(): - block_hashes.extend(self.nodes[3].generate( - min(10, current_height + 1 - self.nodes[3].getblockcount()))) - self.log.debug( - "Syncing {} new blocks...".format(len(block_hashes))) + 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.sync_node3blocks(block_hashes) utxo_list = self.nodes[3].listunspent() self.log.debug("Node3 utxo count: {}".format(len(utxo_list)))