Added tor restart button to index and tor restart command. Enabled tor restart daemon event

This commit is contained in:
Kevin Froman 2020-09-15 17:08:50 +00:00
parent b4d80da3ff
commit 1f067f614a
9 changed files with 63 additions and 6 deletions

View file

@ -53,7 +53,7 @@ def net_check(comm_inst):
'the Internet, and is Tor working? ' +
'This is usually temporary, but bugs and censorship can cause this to persist, in which case you should report it to beardog [at] mailbox.org', # noqa
terminal=True)
restarttor.restart(comm_inst)
restarttor.restart(comm_inst.shared_state)
kv.put('offlinePeers', [])
kv.put('isOnline', False)
else:

View file

@ -21,8 +21,8 @@ import config
"""
def restart(comm_inst):
def restart(shared_state):
if not config.get('tor.use_existing_tor', False):
net = comm_inst.shared_state.get(netcontroller.NetController)
net = shared_state.get(netcontroller.NetController)
net.killTor()
net.startTor()