From 6c75c525d258e3f5ef99cb4f7054f305f0cf8cfa Mon Sep 17 00:00:00 2001 From: Kevin Date: Sun, 21 Jun 2020 17:54:30 -0500 Subject: [PATCH] added gettoraddress private endpoint --- src/httpapi/miscclientapi/endpoints.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/httpapi/miscclientapi/endpoints.py b/src/httpapi/miscclientapi/endpoints.py index 0c48dfea..4ada89bc 100644 --- a/src/httpapi/miscclientapi/endpoints.py +++ b/src/httpapi/miscclientapi/endpoints.py @@ -20,6 +20,7 @@ from onionrutils import mnemonickeys from onionrutils import bytesconverter from etc import onionrvalues from utils import reconstructhash +from utils.gettransports import get as get_tor """ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -140,3 +141,8 @@ class PrivateEndpoints: def is_tor_ready(): """If Tor is starting up, the web UI is not ready to be used.""" return Response(str(g.too_many.get(NetController).readyState).lower()) + + @private_endpoints_bp.route('/gettoraddress') + def get_tor_address(): + """Return public Tor v3 Onion address for this node""" + return Response(get_tor()[0])