Write the wallet less often
This should speed up synchronization / restoration of large wallets. Wallets are written only when they switch to up_to_date state, or when stop_threads() is called when closing the daemon, or when a command line command finishes.
This commit is contained in:
@@ -1300,7 +1300,7 @@ class ElectrumGui():
|
||||
gap = self.config.get('gap_limit', 5)
|
||||
if gap != 5:
|
||||
wallet.gap_limit = gap
|
||||
wallet.storage.put('gap_limit', gap, True)
|
||||
wallet.storage.put('gap_limit', gap)
|
||||
|
||||
if action == 'create':
|
||||
seed = wallet.make_seed()
|
||||
|
||||
@@ -463,7 +463,7 @@ class InstallWizard(QDialog):
|
||||
elif wallet_type == 'twofactor':
|
||||
wallet_type = '2fa'
|
||||
if action == 'create':
|
||||
self.storage.put('wallet_type', wallet_type, False)
|
||||
self.storage.put('wallet_type', wallet_type)
|
||||
|
||||
if action is None:
|
||||
return
|
||||
@@ -560,7 +560,7 @@ class InstallWizard(QDialog):
|
||||
password = self.password_dialog() if any(map(lambda x: Wallet.is_seed(x) or Wallet.is_xprv(x), key_list)) else None
|
||||
wallet = Wallet.from_multisig(key_list, password, self.storage, t)
|
||||
else:
|
||||
self.storage.put('wallet_type', t, False)
|
||||
self.storage.put('wallet_type', t)
|
||||
# call the constructor to load the plugin (side effect)
|
||||
Wallet(self.storage)
|
||||
wallet = always_hook('installwizard_restore', self, self.storage)
|
||||
|
||||
Reference in New Issue
Block a user