forked from cerc-io/plugeth
p2p: fix decoding of disconnect reason (fixes #200)
This commit is contained in:
parent
ce0c4e5d86
commit
9423401d73
@ -154,11 +154,11 @@ func (bp *baseProtocol) handle(rw MsgReadWriter) error {
|
|||||||
return newPeerError(errProtocolBreach, "extra handshake received")
|
return newPeerError(errProtocolBreach, "extra handshake received")
|
||||||
|
|
||||||
case discMsg:
|
case discMsg:
|
||||||
var reason DiscReason
|
var reason [1]DiscReason
|
||||||
if err := msg.Decode(&reason); err != nil {
|
if err := msg.Decode(&reason); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
bp.peer.Disconnect(reason)
|
bp.peer.Disconnect(reason[0])
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
case pingMsg:
|
case pingMsg:
|
||||||
|
Loading…
Reference in New Issue
Block a user