do not call exit() in the interface module
This commit is contained in:
8
electrum
8
electrum
@@ -241,7 +241,9 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
if not options.offline:
|
if not options.offline:
|
||||||
interface = Interface(config)
|
interface = Interface(config)
|
||||||
interface.start(wait=True)
|
if not interface.start(wait=True):
|
||||||
|
print_msg("Not connected, aborting.")
|
||||||
|
sys.exit(1)
|
||||||
wallet.interface = interface
|
wallet.interface = interface
|
||||||
verifier = WalletVerifier(interface, config)
|
verifier = WalletVerifier(interface, config)
|
||||||
verifier.start()
|
verifier.start()
|
||||||
@@ -359,7 +361,9 @@ if __name__ == '__main__':
|
|||||||
if cmd not in offline_commands and not options.offline:
|
if cmd not in offline_commands and not options.offline:
|
||||||
interface = Interface(config)
|
interface = Interface(config)
|
||||||
interface.register_callback('connected', lambda: sys.stderr.write("Connected to " + interface.connection_msg + "\n"))
|
interface.register_callback('connected', lambda: sys.stderr.write("Connected to " + interface.connection_msg + "\n"))
|
||||||
interface.start()
|
if not interface.start(wait=True):
|
||||||
|
print_msg("Not connected, aborting.")
|
||||||
|
sys.exit(1)
|
||||||
wallet.interface = interface
|
wallet.interface = interface
|
||||||
verifier = WalletVerifier(interface, config)
|
verifier = WalletVerifier(interface, config)
|
||||||
verifier.start()
|
verifier.start()
|
||||||
|
|||||||
@@ -595,8 +595,8 @@ class Interface(threading.Thread):
|
|||||||
# wait until connection is established
|
# wait until connection is established
|
||||||
self.connect_event.wait()
|
self.connect_event.wait()
|
||||||
if not self.is_connected:
|
if not self.is_connected:
|
||||||
print_msg("Not connected, aborting.")
|
return False
|
||||||
sys.exit(1)
|
return True
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
Reference in New Issue
Block a user