| 64 | } |
| 65 | |
| 66 | func (self *ConsensusRound) dropMsg(msg ConsensusMsg) { |
| 67 | msgs := self.msgs[msg.Type()] |
| 68 | for i, m := range msgs { |
| 69 | if m == msg { |
| 70 | // msg found, remove from msg-list |
| 71 | self.msgs[msg.Type()] = append(msgs[:i], msgs[i+1:]...) |
| 72 | // remove from msg-hash-list |
| 73 | for hash, m := range self.msgHashs { |
| 74 | if m == msg { |
| 75 | delete(self.msgHashs, hash) |
| 76 | return |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | func (self *ConsensusRound) hasMsg(msg ConsensusMsg, msgHash common.Uint256) bool { |
| 84 | if _, present := self.msgHashs[msgHash]; present { |