Send tranfer buffer to peer
(p *peer.Peer, msg msgtypes.Message, isConsensus bool)
| 178 | |
| 179 | //Send tranfer buffer to peer |
| 180 | func (this *P2PServer) Send(p *peer.Peer, msg msgtypes.Message, |
| 181 | isConsensus bool) error { |
| 182 | if this.network.IsPeerEstablished(p) { |
| 183 | return this.network.Send(p, msg) |
| 184 | } |
| 185 | log.Warnf("[p2p]send to a not ESTABLISH peer %d", |
| 186 | p.GetID()) |
| 187 | return errors.New("[p2p]send to a not ESTABLISH peer") |
| 188 | } |
| 189 | |
| 190 | // GetID returns local node id |
| 191 | func (this *P2PServer) GetID() uint64 { |
no test coverage detected