Remove extra space from onion url

This commit is contained in:
Taylor Helsper 2020-03-15 17:47:15 -05:00
parent 8769c5d778
commit 2a4f8c7e2d

View File

@ -474,7 +474,7 @@ def get_onion_url_general():
try: try:
if os.path.isfile("/var/lib/tor/mynode/hostname"): if os.path.isfile("/var/lib/tor/mynode/hostname"):
with open("/var/lib/tor/mynode/hostname") as f: with open("/var/lib/tor/mynode/hostname") as f:
return f.read() return f.read().strip()
except: except:
pass pass
return "error" return "error"
@ -483,7 +483,7 @@ def get_onion_url_btc():
try: try:
if os.path.isfile("/var/lib/tor/mynode_btc/hostname"): if os.path.isfile("/var/lib/tor/mynode_btc/hostname"):
with open("/var/lib/tor/mynode_btc/hostname") as f: with open("/var/lib/tor/mynode_btc/hostname") as f:
return f.read() return f.read().strip()
except: except:
pass pass
return "error" return "error"
@ -492,7 +492,7 @@ def get_onion_url_lnd():
try: try:
if os.path.isfile("/var/lib/tor/mynode_lnd/hostname"): if os.path.isfile("/var/lib/tor/mynode_lnd/hostname"):
with open("/var/lib/tor/mynode_lnd/hostname") as f: with open("/var/lib/tor/mynode_lnd/hostname") as f:
return f.read() return f.read().strip()
except: except:
pass pass
return "error" return "error"
@ -501,7 +501,7 @@ def get_onion_url_electrs():
try: try:
if os.path.isfile("/var/lib/tor/mynode_electrs/hostname"): if os.path.isfile("/var/lib/tor/mynode_electrs/hostname"):
with open("/var/lib/tor/mynode_electrs/hostname") as f: with open("/var/lib/tor/mynode_electrs/hostname") as f:
return f.read() return f.read().strip()
except: except:
pass pass
return "error" return "error"