Made ShowDaemonSyncProgressAsync safer
@@ -181,6 +181,8 @@ namespace MiningCore.Blockchain.Ethereum
.Select(x => x.Response.ToObject<SyncState>())
.ToArray();
+ if (syncStates.Any())
+ {
// get peer count
var response = await daemon.ExecuteCmdAllAsync<string>(EC.GetPeerCount);
var validResponses = response.Where(x => x.Error == null && x.Response != null).ToArray();
@@ -195,7 +197,7 @@ namespace MiningCore.Blockchain.Ethereum
logger.Info(() => $"[{LogCat}] Daemons have downloaded {percent:0.00}% of warp-chunks from {peerCount} peers");
}
- else
+ else if (syncStates.Any(x => x.HighestBlock != 0))
{
var lowestHeight = syncStates.Min(x => x.CurrentBlock);
var totalBlocks = syncStates.Max(x => x.HighestBlock);
@@ -205,6 +207,7 @@ namespace MiningCore.Blockchain.Ethereum
}
}
}
+ }
private async Task<bool> SubmitBlockAsync(EthereumShare share)
{
