diff --git a/CryptoExchange.Net/Clients/BaseRestClient.cs b/CryptoExchange.Net/Clients/BaseRestClient.cs index b02357f..b02772e 100644 --- a/CryptoExchange.Net/Clients/BaseRestClient.cs +++ b/CryptoExchange.Net/Clients/BaseRestClient.cs @@ -172,11 +172,17 @@ namespace CryptoExchange.Net if (signed) { - var syncTimeResult = await apiClient.SyncTimeAsync().ConfigureAwait(false); - if (!syncTimeResult) + var syncTask = apiClient.SyncTimeAsync(); + var timeSyncInfo = apiClient.GetTimeSyncInfo(); + if (timeSyncInfo.TimeSyncState.LastSyncTime == default) { - log.Write(LogLevel.Debug, $"[{requestId}] Failed to sync time, aborting request: " + syncTimeResult.Error); - return syncTimeResult.As(default); + // Initially with first request we'll need to wait for the time syncing, if it's not the first request we can just continue + var syncTimeResult = await syncTask.ConfigureAwait(false); + if (!syncTimeResult) + { + log.Write(LogLevel.Debug, $"[{requestId}] Failed to sync time, aborting request: " + syncTimeResult.Error); + return syncTimeResult.As(default); + } } } diff --git a/CryptoExchange.Net/Clients/RestApiClient.cs b/CryptoExchange.Net/Clients/RestApiClient.cs index 2112c21..53fa555 100644 --- a/CryptoExchange.Net/Clients/RestApiClient.cs +++ b/CryptoExchange.Net/Clients/RestApiClient.cs @@ -18,7 +18,7 @@ namespace CryptoExchange.Net /// Get time sync info for an API client /// /// - protected abstract TimeSyncInfo GetTimeSyncInfo(); + public abstract TimeSyncInfo GetTimeSyncInfo(); /// /// Get time offset for an API client