소스 검색

p2p: fix decoding of disconnect reason (fixes #200)

Felix Lange 11 년 전
부모
커밋
9423401d73
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      p2p/protocol.go

+ 2 - 2
p2p/protocol.go

@@ -154,11 +154,11 @@ func (bp *baseProtocol) handle(rw MsgReadWriter) error {
 		return newPeerError(errProtocolBreach, "extra handshake received")
 
 	case discMsg:
-		var reason DiscReason
+		var reason [1]DiscReason
 		if err := msg.Decode(&reason); err != nil {
 			return err
 		}
-		bp.peer.Disconnect(reason)
+		bp.peer.Disconnect(reason[0])
 		return nil
 
 	case pingMsg: