diff --git a/src/ssb.c b/src/ssb.c index c7a727ba..e6bb3ff8 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -2311,6 +2311,12 @@ static void _tf_ssb_connection_tunnel_callback( tf_ssb_connection_t* tf_ssb_connection_tunnel_create(tf_ssb_t* ssb, const char* portal_id, int32_t request_number, const char* target_id) { + if (tf_ssb_connection_get(ssb, target_id)) + { + /* Already have a possibly more direct connection to target. */ + return NULL; + } + tf_ssb_connection_t* connection = tf_ssb_connection_get(ssb, portal_id); JSContext* context = ssb->context;