storage: fix some madness about get_data_ref() and put() interacting badly
previously load_transactions() had to be called before upgrade();
now we reverse this order.
to reproduce/illustrate issue, before this commit:
try running convert_version_17 and convert_version_18
(e.g. see testcase test_upgrade_from_client_2_9_3_old_seeded_with_realistic_history)
and then in qt console:
>> wallet.storage.db.get_data_ref('spent_outpoints') == wallet.storage.db.spent_outpoints
False
>> wallet.storage.db.get_data_ref('verified_tx3') == wallet.storage.db.verified_tx
False
This commit is contained in:
@@ -305,7 +305,13 @@ class TestStorageUpgrade(WalletTestCase):
|
||||
storage2 = self._load_storage_from_json_string(wallet_json=wallet_json,
|
||||
path=path2,
|
||||
manual_upgrades=False)
|
||||
storage2.write()
|
||||
self._sanity_check_upgraded_storage(storage2)
|
||||
# test opening upgraded storages again
|
||||
s1 = WalletStorage(path2, manual_upgrades=False)
|
||||
self._sanity_check_upgraded_storage(s1)
|
||||
s2 = WalletStorage(path2, manual_upgrades=True)
|
||||
self._sanity_check_upgraded_storage(s2)
|
||||
else:
|
||||
storage = self._load_storage_from_json_string(wallet_json=wallet_json,
|
||||
path=self.wallet_path,
|
||||
|
||||
Reference in New Issue
Block a user