Ensure the backend receives the latest settings object before starting the onion service, and likewise for the GUI, so that we absolutely always save the private key for persistence back to the json settings file when we need to

This commit is contained in:
Miguel Jacq 2019-09-16 14:51:16 +10:00
parent 320cac0ad1
commit bd493d20a7
2 changed files with 7 additions and 0 deletions

View File

@ -438,6 +438,10 @@ class Onion(object):
return the onion hostname.
"""
self.common.log('Onion', 'start_onion_service')
# Settings may have changed in the frontend but not updated in our settings object,
# such as persistence. Reload the settings now just to be sure.
self.settings.load()
self.auth_string = None
if not self.supports_ephemeral:

View File

@ -240,6 +240,9 @@ class ServerStatus(QtWidgets.QWidget):
"""
# Set the URL fields
if self.status == self.STATUS_STARTED:
# The backend Onion may have saved new settings, such as the private key.
# Reload the settings before saving new ones.
self.common.settings.load()
self.show_url()
if self.common.settings.get('save_private_key'):