()
| 138 | } |
| 139 | |
| 140 | func (self *Server) constructHandshakeMsg() (*peerHandshakeMsg, error) { |
| 141 | |
| 142 | blkNum := self.GetCurrentBlockNo() - 1 |
| 143 | block, blockhash := self.blockPool.getSealedBlock(blkNum) |
| 144 | if block == nil { |
| 145 | return nil, fmt.Errorf("failed to get sealed block, current block: %d", self.GetCurrentBlockNo()) |
| 146 | } |
| 147 | msg := &peerHandshakeMsg{ |
| 148 | CommittedBlockNumber: blkNum, |
| 149 | CommittedBlockHash: blockhash, |
| 150 | CommittedBlockLeader: block.getProposer(), |
| 151 | ChainConfig: self.config, |
| 152 | } |
| 153 | |
| 154 | return msg, nil |
| 155 | } |
| 156 | |
| 157 | func (self *Server) constructHeartbeatMsg() (*peerHeartbeatMsg, error) { |
| 158 |
nothing calls this directly
no test coverage detected