diff --git a/peer_protocol/protocol.go b/peer_protocol/protocol.go index bfeb6a0448..2f92ab324d 100644 --- a/peer_protocol/protocol.go +++ b/peer_protocol/protocol.go @@ -41,6 +41,11 @@ const ( // BEP 10 Extended MessageType = 20 + + // BEP 52 + HashRequest = 21 + Hashes = 22 + HashReject = 23 ) const ( diff --git a/peerconn.go b/peerconn.go index a1e98b1282..ded9b483e5 100644 --- a/peerconn.go +++ b/peerconn.go @@ -862,6 +862,8 @@ func (c *PeerConn) mainReadLoop() (err error) { c.updateRequests("PeerConn.mainReadLoop allowed fast") case pp.Extended: err = c.onReadExtendedMsg(msg.ExtendedID, msg.ExtendedPayload) + case pp.HashRequest, pp.Hashes, pp.HashReject: + err = log.WithLevel(log.Warning, fmt.Errorf("received unimplemented BitTorrent v2 message: %v", msg.Type)) default: err = fmt.Errorf("received unknown message type: %#v", msg.Type) }