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

Method getProposerRankLocked

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

Source from the content-addressed store, hash-verified

151}
152
153func (self *Server) getProposerRankLocked(blockNum uint32, peerIdx uint32) int {
154 if blockNum == self.currentParticipantConfig.BlockNum {
155 for rank, id := range self.currentParticipantConfig.Proposers {
156 if id == peerIdx {
157 return rank
158 }
159 }
160 } else {
161 log.Errorf("todo: get proposer config for non-current blocknum:%d, current.BlockNum%d,peerIdx:%d", blockNum, self.currentParticipantConfig.BlockNum, peerIdx)
162 }
163 return len(self.currentParticipantConfig.Proposers)
164}
165
166func (self *Server) getHighestRankProposal(blockNum uint32, proposals []*blockProposalMsg) *blockProposalMsg {
167 self.metaLock.RLock()

Callers 3

getProposerRankMethod · 0.95

Calls 1

ErrorfFunction · 0.92

Tested by 1