Skip to content

Commit

Permalink
Try to get headers from remote nodes even the current header height i…
Browse files Browse the repository at this point in the history
…s higher than them if it is not updated for a while
  • Loading branch information
yongjiema committed Jul 22, 2019
1 parent ee95314 commit eb5ec67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neo/Network/P2P/TaskManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ private void RequestTasks(TaskSession session)
}
if ((!HasHeaderTask || globalTasks[HeaderTaskHash] < MaxConncurrentTasks)
&& (Blockchain.Singleton.HeaderHeight < session.Version.StartHeight
|| (Blockchain.Singleton.HeaderHeight == session.Version.StartHeight
&& Blockchain.Singleton.HeaderHeight == sessions.Select(x => x.Value.Version.StartHeight).Max()
|| (Blockchain.Singleton.Height == Blockchain.Singleton.HeaderHeight
&& Blockchain.Singleton.HeaderHeight >= sessions.Select(x => x.Value.Version.StartHeight).Max()
&& TimeProvider.Current.UtcNow.ToTimestamp() - 60 >= Blockchain.Singleton.GetBlock(Blockchain.Singleton.CurrentHeaderHash)?.Timestamp)))
{
session.Tasks[HeaderTaskHash] = DateTime.UtcNow;
Expand Down

0 comments on commit eb5ec67

Please sign in to comment.