Skip to content

Commit

Permalink
Use global network instance
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-lundqvist committed Mar 18, 2021
1 parent 021ea42 commit 35cc816
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions electroncash_gui/qt/installwizard.py
Expand Up @@ -670,17 +670,18 @@ def run(self):
keys = k.dump()
tmp_storage.put('keystore', keys)
wallet = Standard_Wallet(tmp_storage)
network = Network(self.parent.config)
network.start()
wallet.start_threads(network)
wallet.synchronize()
wallet.wait_until_synchronized()
while network.is_connecting():
time.sleep(0.1)

num_tx = len(wallet.get_history())
wallet.clear_history()
self.progress_cb(i, str(num_tx))
network = Network.get_instance()
if network:
wallet.start_threads(network)
wallet.synchronize()
wallet.wait_until_synchronized()
while network.is_connecting():
time.sleep(0.1)
num_tx = len(wallet.get_history())
wallet.clear_history()
self.progress_cb(i, str(num_tx))
else:
self.progress_cb(i, _('Offline'))

class DerivationDialog(QDialog):
def __init__(self, parent, seed, paths):
Expand Down

0 comments on commit 35cc816

Please sign in to comment.