You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 95038fc
Browse filesBrowse the repository at this point in the historyBrowse files
Idle too long error incorrectly triggered even when peer sending new blocks
- fix status chain map uses common.Hash as key
- add badPeers increment to IncorrectTD errors (forgotten)
- signal head info update to head section process even if parent hash is not in pool (inserted), so that idle timer can be set to nil
- suicideC -> peer.headInfoTimer
- quit -> peer.bestIdleTimer
- and they are properly set from within getBlockHashes and handleSection
// if sec == nil, it signals that chain info has updated (new block message)
540
545
casesec:=<-self.headSectionC:
541
546
self.handleSection(sec)
542
-
ifsec==nil {
543
-
plog.Debugf("HeadSection: <%s> (headsection [%s], received: [%s]) quit channel set to nil, catchup happening", self.id, sectionhex(self.headSection), sectionhex(sec))
544
-
quit=nil
545
-
} else {
546
-
plog.Debugf("HeadSection: <%s> (headsection [%s], received: [%s]) quit channel set to go off in IdleBestPeerTimeout", self.id, sectionhex(self.headSection), sectionhex(sec))
// periodic check for block hashes or parent block/section
551
549
case<-self.blockHashesRequestTimer:
@@ -560,7 +558,7 @@ LOOP:
560
558
self.getCurrentBlock(nil)
561
559
562
560
// quitting on timeout
563
-
case<-self.suicideC:
561
+
case<-self.headInfoTimer:
564
562
self.peerError(self.bp.peers.errors.New(ErrInsufficientChainInfo, "timed out without providing block hashes or head block (td: %v, head: %s)", self.td, hex(self.currentBlockHash)))
565
563
566
564
self.bp.status.lock.Lock()
@@ -583,7 +581,7 @@ LOOP:
583
581
break LOOP
584
582
585
583
// quit
586
-
case<-quit:
584
+
case<-self.bestIdleTimer:
587
585
self.peerError(self.bp.peers.errors.New(ErrIdleTooLong, "timed out without providing new blocks (td: %v, head: %s)...quitting", self.td, hex(self.currentBlockHash)))
0 commit comments