diff options
Diffstat (limited to 'p2p/peer.go')
-rw-r--r-- | p2p/peer.go | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/p2p/peer.go b/p2p/peer.go index c7ec08887..562fbc1b4 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -273,20 +273,6 @@ func (p *Peer) getProto(code uint64) (*protoRW, error) { return nil, newPeerError(errInvalidMsgCode, "%d", code) } -// writeProtoMsg sends the given message on behalf of the given named protocol. -// this exists because of Server.Broadcast. -func (p *Peer) writeProtoMsg(protoName string, msg Msg) error { - proto, ok := p.running[protoName] - if !ok { - return fmt.Errorf("protocol %s not handled by peer", protoName) - } - if msg.Code >= proto.Length { - return newPeerError(errInvalidMsgCode, "code %x is out of range for protocol %q", msg.Code, protoName) - } - msg.Code += proto.offset - return p.rw.WriteMsg(msg) -} - type protoRW struct { Protocol in chan Msg |