Method
isPeerActive
(peerIdx uint32, blockNum uint32)
Source from the content-addressed store, hash-verified
| 52 | } |
| 53 | |
| 54 | func (self *Server) isPeerActive(peerIdx uint32, blockNum uint32) bool { |
| 55 | if self.isPeerAlive(peerIdx, blockNum) { |
| 56 | p := self.peerPool.getPeer(peerIdx) |
| 57 | if p == nil { |
| 58 | return false |
| 59 | } |
| 60 | |
| 61 | if p.LatestInfo != nil { |
| 62 | return p.LatestInfo.CommittedBlockNumber+MAX_SYNCING_CHECK_BLK_NUM*4 > self.GetCommittedBlockNo() |
| 63 | } |
| 64 | return true |
| 65 | } |
| 66 | |
| 67 | return false |
| 68 | } |
| 69 | |
| 70 | // |
| 71 | // the first proposer as leader-proposer, |