tor can now be attached

master
Kevin Froman 2020-01-31 22:14:26 -06:00
parent ea47ae456b
commit cd671feb92
2 changed files with 11 additions and 3 deletions

View File

@ -114,7 +114,10 @@ def daemon():
if use_existing_tor:
net.socksPort = config.get('tor.existing_socks_port')
net.myID = create_onion_service(port=get_open_port())
net.myID = create_onion_service(
port=net.apiServerIP + ':' + str(net.hsPort))[0]
if not net.myID.endswith('.onion'):
net.myID += '.onion'
with open(filepaths.tor_hs_address_file, 'w') as tor_file:
tor_file.write(net.myID)
else:
@ -141,6 +144,11 @@ def daemon():
if not offline_mode and not use_existing_tor:
net.killTor()
else:
try:
os.remove(filepaths.tor_hs_address_file)
except FileNotFoundError:
pass
better_sleep(5)