mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
Another fix for stuck header download (#4433)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
This commit is contained in:
parent
8e3ac8a21c
commit
1cc5b92dd8
@ -418,11 +418,10 @@ func (cs *MultiClient) blockHeaders(ctx context.Context, pkt eth.BlockHeadersPac
|
||||
req, penalties := cs.Hd.RequestMoreHeaders(currentTime)
|
||||
if req != nil {
|
||||
if _, sentToPeer := cs.SendHeaderRequest(ctx, req); sentToPeer {
|
||||
// If request was actually sent to a peer, we update retry time to be 5 seconds in the future
|
||||
cs.Hd.UpdateRetryTime(req, currentTime, 5*time.Second /* timeout */)
|
||||
log.Trace("Sent request", "height", req.Number)
|
||||
cs.Hd.UpdateStats(req, false /* skeleton */)
|
||||
}
|
||||
// Regardless of whether request was actually sent to a peer, we update retry time to be 5 seconds in the future
|
||||
cs.Hd.UpdateRetryTime(req, currentTime, 5*time.Second /* timeout */)
|
||||
}
|
||||
if len(penalties) > 0 {
|
||||
cs.Penalize(ctx, penalties)
|
||||
|
@ -738,10 +738,10 @@ Loop:
|
||||
if req != nil {
|
||||
_, sentToPeer = cfg.headerReqSend(ctx, req)
|
||||
if sentToPeer {
|
||||
// If request was actually sent to a peer, we update retry time to be 5 seconds in the future
|
||||
cfg.hd.UpdateRetryTime(req, currentTime, 5*time.Second /* timeout */)
|
||||
log.Trace("Sent request", "height", req.Number)
|
||||
cfg.hd.UpdateStats(req, false /* skeleton */)
|
||||
}
|
||||
// Regardless of whether request was actually sent to a peer, we update retry time to be 5 seconds in the future
|
||||
cfg.hd.UpdateRetryTime(req, currentTime, 5*time.Second /* timeout */)
|
||||
}
|
||||
if len(penalties) > 0 {
|
||||
cfg.penalize(ctx, penalties)
|
||||
@ -752,12 +752,10 @@ Loop:
|
||||
if req != nil {
|
||||
_, sentToPeer = cfg.headerReqSend(ctx, req)
|
||||
if sentToPeer {
|
||||
// If request was actually sent to a peer, we update retry time to be 5 seconds in the future
|
||||
cfg.hd.UpdateRetryTime(req, currentTime, 5*time.Second /*timeout */)
|
||||
log.Trace("Sent request", "height", req.Number)
|
||||
cfg.hd.UpdateStats(req, false /* skeleton */)
|
||||
|
||||
}
|
||||
// Regardless of whether request was actually sent to a peer, we update retry time to be 5 seconds in the future
|
||||
cfg.hd.UpdateRetryTime(req, currentTime, 5*time.Second /* timeout */)
|
||||
}
|
||||
if len(penalties) > 0 {
|
||||
cfg.penalize(ctx, penalties)
|
||||
@ -771,7 +769,6 @@ Loop:
|
||||
if req != nil {
|
||||
_, sentToPeer = cfg.headerReqSend(ctx, req)
|
||||
if sentToPeer {
|
||||
log.Trace("Sent skeleton request", "height", req.Number)
|
||||
cfg.hd.UpdateStats(req, true /* skeleton */)
|
||||
lastSkeletonTime = time.Now()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user