MCPcopy Create free account
hub / github.com/DNAProject/DNA / isPeerActive

Method isPeerActive

consensus/vbft/node_utils.go:54–68  ·  view source on GitHub ↗
(peerIdx uint32, blockNum uint32)

Source from the content-addressed store, hash-verified

52}
53
54func (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,

Callers 3

isEndorserMethod · 0.95
isCommitterMethod · 0.95
TestIsPeerActiveFunction · 0.80

Calls 3

isPeerAliveMethod · 0.95
GetCommittedBlockNoMethod · 0.95
getPeerMethod · 0.80

Tested by 1

TestIsPeerActiveFunction · 0.64