Skip to content

Commit b60e02e

Browse files
committed
test: fix test wallet_transactiontime_rescan.py for descriptor wallets
1 parent a905ed1 commit b60e02e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/functional/wallet_transactiontime_rescan.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ def run_test(self):
119119
restorenode.createwallet(wallet_name='wo', disable_private_keys=True)
120120
restorewo_wallet = restorenode.get_wallet_rpc('wo')
121121

122+
# for descriptor wallets, the test framework maps the importaddress RPC to the
123+
# importdescriptors RPC (with argument 'timestamp'='now'), which always rescans
124+
# blocks of the past 2 hours, based on the current MTP timestamp; in order to avoid
125+
# importing the last address (wo3), we advance the time further and generate 10 blocks
126+
if self.options.descriptors:
127+
set_node_times(self.nodes, cur_time + ten_days + ten_days + ten_days + ten_days)
128+
self.generatetoaddress(minernode, 10, m1)
129+
122130
restorewo_wallet.importaddress(wo1, rescan=False)
123131
restorewo_wallet.importaddress(wo2, rescan=False)
124132
restorewo_wallet.importaddress(wo3, rescan=False)

0 commit comments

Comments
 (0)