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

Method isCommitter

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

Source from the content-addressed store, hash-verified

128}
129
130func (self *Server) isCommitter(blockNum uint32, peerIdx uint32) bool {
131 self.metaLock.RLock()
132 defer self.metaLock.RUnlock()
133
134 // the first 2C+1 active committers
135 var activeN uint32
136 {
137 for _, id := range self.currentParticipantConfig.Committers {
138 if id == peerIdx {
139 return true
140 }
141 if self.isPeerActive(id, blockNum) {
142 activeN++
143 if activeN > self.config.C*2 {
144 break
145 }
146 }
147 }
148 }
149
150 return false
151}
152
153func (self *Server) getProposerRankLocked(blockNum uint32, peerIdx uint32) int {
154 if blockNum == self.currentParticipantConfig.BlockNum {

Callers 5

processMsgEventMethod · 0.95
actionLoopMethod · 0.95
commitBlockMethod · 0.95
catchConsensusMethod · 0.95
TestIsCommitterFunction · 0.80

Calls 1

isPeerActiveMethod · 0.95

Tested by 1

TestIsCommitterFunction · 0.64