@@ -302,9 +302,9 @@ def run_test(self):
302
302
node_v17 .rpc .createwallet (wallet_name = "u1_v17" )
303
303
wallet = node_v17 .get_wallet_rpc ("u1_v17" )
304
304
address = wallet .getnewaddress ("bech32" )
305
- info = wallet .getaddressinfo (address )
306
- hdkeypath = info ["hdkeypath" ]
307
- pubkey = info ["pubkey" ]
305
+ v17_info = wallet .getaddressinfo (address )
306
+ hdkeypath = v17_info ["hdkeypath" ]
307
+ pubkey = v17_info ["pubkey" ]
308
308
309
309
# Copy the 0.17 wallet to the last Bitcoin Core version and open it:
310
310
node_v17 .unloadwallet ("u1_v17" )
@@ -318,6 +318,18 @@ def run_test(self):
318
318
descriptor = "wpkh([" + info ["hdmasterfingerprint" ] + hdkeypath [1 :] + "]" + pubkey + ")"
319
319
assert_equal (info ["desc" ], descsum_create (descriptor ))
320
320
321
+ # Now copy that same wallet back to 0.17 to make sure no automatic upgrade breaks it
322
+ node_master .unloadwallet ("u1_v17" )
323
+ shutil .rmtree (os .path .join (node_v17_wallets_dir , "u1_v17" ))
324
+ shutil .copytree (
325
+ os .path .join (node_master_wallets_dir , "u1_v17" ),
326
+ os .path .join (node_v17_wallets_dir , "u1_v17" )
327
+ )
328
+ node_v17 .loadwallet ("u1_v17" )
329
+ wallet = node_v17 .get_wallet_rpc ("u1_v17" )
330
+ info = wallet .getaddressinfo (address )
331
+ assert_equal (info , v17_info )
332
+
321
333
# Copy the 0.19 wallet to the last Bitcoin Core version and open it:
322
334
shutil .copytree (
323
335
os .path .join (node_v19_wallets_dir , "w1_v19" ),
@@ -327,5 +339,16 @@ def run_test(self):
327
339
wallet = node_master .get_wallet_rpc ("w1_v19" )
328
340
assert wallet .getaddressinfo (address_18075 )["solvable" ]
329
341
342
+ # Now copy that same wallet back to 0.19 to make sure no automatic upgrade breaks it
343
+ node_master .unloadwallet ("w1_v19" )
344
+ shutil .rmtree (os .path .join (node_v19_wallets_dir , "w1_v19" ))
345
+ shutil .copytree (
346
+ os .path .join (node_master_wallets_dir , "w1_v19" ),
347
+ os .path .join (node_v19_wallets_dir , "w1_v19" )
348
+ )
349
+ node_v19 .loadwallet ("w1_v19" )
350
+ wallet = node_v19 .get_wallet_rpc ("w1_v19" )
351
+ assert wallet .getaddressinfo (address_18075 )["solvable" ]
352
+
330
353
if __name__ == '__main__' :
331
354
BackwardsCompatibilityTest ().main ()
0 commit comments