(blkNum uint32, stateRoot common.Uint256)
| 233 | } |
| 234 | |
| 235 | func (self *Server) CheckSubmitBlock(blkNum uint32, stateRoot common.Uint256) bool { |
| 236 | cMsgs := self.msgPool.GetBlockSubmitMsgNums(blkNum) |
| 237 | var stateRootCnt uint32 |
| 238 | for _, msg := range cMsgs { |
| 239 | c := msg.(*blockSubmitMsg) |
| 240 | if c != nil { |
| 241 | if c.BlockStateRoot == stateRoot { |
| 242 | stateRootCnt++ |
| 243 | } else { |
| 244 | continue |
| 245 | } |
| 246 | } |
| 247 | } |
| 248 | m := self.config.N - (self.config.N-1)/3 |
| 249 | if stateRootCnt < uint32(m) { |
| 250 | return false |
| 251 | } |
| 252 | return true |
| 253 | } |
| 254 | |
| 255 | func (self *Server) NewConsensusPayload(payload *p2pmsg.ConsensusPayload) { |
| 256 | peerID := vconfig.PubkeyID(payload.Owner) |
no test coverage detected