From 5e0733d7f4788f7e8b342089934a168b05c4d9f8 Mon Sep 17 00:00:00 2001 From: JKorf Date: Sun, 14 Jul 2024 20:59:22 +0200 Subject: [PATCH] Fixed trying to authenticate dedicated connection when no credentials are set --- CryptoExchange.Net/Sockets/SocketConnection.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CryptoExchange.Net/Sockets/SocketConnection.cs b/CryptoExchange.Net/Sockets/SocketConnection.cs index 7b6014f..502468f 100644 --- a/CryptoExchange.Net/Sockets/SocketConnection.cs +++ b/CryptoExchange.Net/Sockets/SocketConnection.cs @@ -834,7 +834,11 @@ namespace CryptoExchange.Net.Sockets bool anyAuthenticated; lock (_listenersLock) - anyAuthenticated = _listeners.OfType().Any(s => s.Authenticated) || DedicatedRequestConnection; + { + anyAuthenticated = _listeners.OfType().Any(s => s.Authenticated) + || (DedicatedRequestConnection && ApiClient.AuthenticationProvider != null); + } + if (anyAuthenticated) { // If we reconnected a authenticated connection we need to re-authenticate