| 151 | } |
| 152 | |
| 153 | func (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 | |
| 166 | func (self *Server) getHighestRankProposal(blockNum uint32, proposals []*blockProposalMsg) *blockProposalMsg { |
| 167 | self.metaLock.RLock() |