Ensure we always set the service id, so we can stop the right one (particularly when scheduling a share)

This commit is contained in:
Miguel Jacq 2019-11-29 18:40:45 +11:00
parent 60de9fd335
commit 9ce2c5cedf
No known key found for this signature in database
GPG Key ID: EEA4341C6D97A0B6
2 changed files with 2 additions and 4 deletions

View File

@ -666,8 +666,7 @@ class Onion(object):
onion_host = res.service_id + ".onion"
# Save the service_id
if not mode_settings.get("general", "service_id"):
mode_settings.set("general", "service_id", res.service_id)
mode_settings.set("general", "service_id", res.service_id)
# Save the private key and hidservauth string if persistence is enabled
if mode_settings.get("persistent", "enabled"):
@ -712,7 +711,6 @@ class Onion(object):
"""
onion_host = mode_settings.get("general", "service_id")
self.common.log("Onion", "stop_onion_service", f"onion host: {onion_host}")
try:
self.c.remove_ephemeral_hidden_service(
mode_settings.get("general", "service_id")

View File

@ -76,7 +76,7 @@ class OnionThread(QtCore.QThread):
time.sleep(0.2)
self.success_early.emit()
# Unregister the onion so we can use it in the next OnionThread
self.mode.app.onion.cleanup(False)
self.mode.app.stop_onion_service(self.mode.settings)
else:
self.mode.app.start_onion_service(
self.mode.settings, await_publication=True