You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge bitcoin/bitcoin#29124: test: Test that migration automatically repairs corrupted metadata with doubled derivation path
c7e2b9e tests: Test migration cleans up bad inactive chain derivation path (Ava Chow)
Pull request description:
A bug in 0.21.x and 22.x resulted in some wallets having invalid derivation paths that are the concatenation of two derivation paths. These appear only when inactive hd chains are topped up.
Since key metadata is a legacy wallet only record, migrating legacy wallets to descriptor wallets will fix this issue as all key metadata records are deleted. The derivation path information is derived on-the-fly from the descriptor that is produced for the inactive hd chain.
Thus we only need a test to verify that the derivation paths are good, and that all key metadata records are deleted from the migrated wallet.
ACKs for top commit:
murchandamus:
re-ACK c7e2b9e via range-diff:
rkrux:
re-ACK c7e2b9e
furszy:
utACK c7e2b9e
Tree-SHA512: 3117c4a43798972109fe2d3539341a8b69db70c6457fcabdd019e6044834dc4b17212abbc006d7b8008f560dce4b7856142b057981b9404f406d58fa0955cbd9
# Retrieve all records that have the "keymeta" prefix. The remaining key data varies for each record.
158
+
keymeta_rec=conn.execute("SELECT value FROM main where key >= x'076b65796d657461' AND key < x'076b65796d657462'").fetchone()
159
+
assert_equal(keymeta_rec, None)
160
+
conn.close()
161
+
exceptImportError:
162
+
self.log.warning("sqlite3 module not available, skipping lack of keymeta records check")
163
+
84
164
defrun_test(self):
85
165
node_miner=self.nodes[0]
86
166
node_master=self.nodes[1]
@@ -300,5 +380,7 @@ def run_test(self):
300
380
# Legacy wallets are no longer supported. Trying to load these should result in an error
301
381
assert_raises_rpc_error(-18, "The wallet appears to be a Legacy wallet, please use the wallet migration tool (migratewallet RPC)", node_master.restorewallet, wallet_name, backup_path)
0 commit comments