Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Ergo sync status check improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Weichhold committed Dec 12, 2021
1 parent b353fdb commit 6bdb042
Show file tree
Hide file tree
Showing 4 changed files with 1,713 additions and 1,592 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/Miningcore/Blockchain/Ergo/ErgoJobManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,11 @@ protected override async Task EnsureDaemonsSynchedAsync(CancellationToken ct)
var info = await Guard(() => ergoClient.GetNodeInfoAsync(ct),
ex=> logger.Debug(ex));

var isSynched = info?.FullHeight.HasValue == true && info?.HeadersHeight.HasValue == true &&
info.FullHeight.Value >= info.HeadersHeight.Value;
var peerInfos = await Guard(() => ergoClient.GetPeersFullInfoAsync(ct),
ex=> logger.Debug(ex));

var isSynched = peerInfos?.All(x=> x.Status == "Equal") == true ||
info?.FullHeight.HasValue == true && info.HeadersHeight.HasValue && info.FullHeight.Value >= info.HeadersHeight.Value;

if(isSynched)
{
Expand Down
Loading

0 comments on commit 6bdb042

Please sign in to comment.