File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -614,6 +614,11 @@ func (c *PrunedPeer) NextConnection() time.Time {
614614 if c .DelayObj .GetType () == Minus1DelayType { // in case of Minus1, this is new peer and we want it to connect as soon as possible
615615 return time.Time {}
616616 }
617+
618+ if c .DelayObj .CalculateDelay () > MaxDelayTime {
619+ return c .BaseConnectionTimestamp .Add (MaxDelayTime )
620+ }
621+
617622 // nextConnection should be from first event + the applied delay
618623 return c .BaseConnectionTimestamp .Add (c .DelayObj .CalculateDelay ())
619624}
@@ -657,10 +662,7 @@ func (c *PrunedPeer) UpdateDelay(newDelayType string) {
657662 c .BaseDeprecationTimestamp = time .Now ()
658663 }
659664
660- // only add degree in case we have not exceeded the MaxDelay allowed
661- if c .DelayObj .CalculateDelay () < MaxDelayTime {
662- c .DelayObj .AddDegree ()
663- }
665+ c .DelayObj .AddDegree ()
664666}
665667
666668// ErrorToDelayType:
You can’t perform that action at this time.
0 commit comments