From 1b37dceb28a3afdebad625f9ce3cb9be50094900 Mon Sep 17 00:00:00 2001 From: akwizgran Date: Fri, 17 Jul 2020 16:55:30 +0100 Subject: [PATCH] Only add the onion hostname to transport properties once. --- .../org/briarproject/bramble/plugin/tor/TorPlugin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bramble-core/src/main/java/org/briarproject/bramble/plugin/tor/TorPlugin.java b/bramble-core/src/main/java/org/briarproject/bramble/plugin/tor/TorPlugin.java index 14d6a5d90..dbe63e774 100644 --- a/bramble-core/src/main/java/org/briarproject/bramble/plugin/tor/TorPlugin.java +++ b/bramble-core/src/main/java/org/briarproject/bramble/plugin/tor/TorPlugin.java @@ -514,15 +514,15 @@ abstract class TorPlugin implements DuplexPlugin, EventHandler, EventListener { LOG.warning("Tor did not return a private key"); return; } - // Publish the hidden service's onion hostname in transport properties String onion3 = response.get(HS_ADDRESS); if (LOG.isLoggable(INFO)) { LOG.info("V3 hidden service " + scrubOnion(onion3)); } - TransportProperties p = new TransportProperties(); - p.put(PROP_ONION_V3, onion3); - callback.mergeLocalProperties(p); if (privKey == null) { + // Publish the hidden service's onion hostname in transport props + TransportProperties p = new TransportProperties(); + p.put(PROP_ONION_V3, onion3); + callback.mergeLocalProperties(p); // Save the hidden service's private key for next time Settings s = new Settings(); s.put(HS_PRIVATE_KEY_V3, response.get(HS_PRIVKEY));