File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -332,11 +332,11 @@ func (p *Peer) handle(msg Msg) error {
332332 msg .Discard ()
333333 go SendItems (p .rw , pongMsg )
334334 case msg .Code == discMsg :
335- var reason [1 ]DiscReason
336335 // This is the last message. We don't need to discard or
337336 // check errors because, the connection will be closed after it.
338- rlp .Decode (msg .Payload , & reason )
339- return reason [0 ]
337+ var m struct { R DiscReason }
338+ rlp .Decode (msg .Payload , & m )
339+ return m .R
340340 case msg .Code < baseProtocolLength :
341341 // ignore other base protocol messages
342342 return msg .Discard ()
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ func (pe *peerError) Error() string {
5454
5555var errProtocolReturned = errors .New ("protocol returned" )
5656
57- type DiscReason uint
57+ type DiscReason uint8
5858
5959const (
6060 DiscRequested DiscReason = iota
You can’t perform that action at this time.
0 commit comments