We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c6a11fe + 941920f commit 382d35bCopy full SHA for 382d35b
eth/handler.go
@@ -413,10 +413,12 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
413
414
pm.fetcher.Enqueue(p.id, request.Block)
415
416
- // TODO: Schedule a sync to cover potential gaps (this needs proto update)
+ // Update the peers total difficulty if needed, schedule a download if gapped
417
if request.TD.Cmp(p.Td()) > 0 {
418
p.SetTd(request.TD)
419
- go pm.synchronise(p)
+ if request.TD.Cmp(new(big.Int).Add(pm.chainman.Td(), request.Block.Difficulty())) > 0 {
420
+ go pm.synchronise(p)
421
+ }
422
}
423
424
case TxMsg:
0 commit comments