stop peer if it sends us msg with unknown channel

This commit is contained in:
Anton Kaliaev 2018-03-04 14:36:06 +04:00
parent d0c67bbe16
commit d86855ad7a
No known key found for this signature in database
GPG Key ID: 7B6881D965918214

View File

@ -358,7 +358,7 @@ func createMConnection(conn net.Conn, p *peer, reactorsByCh map[byte]Reactor, ch
onReceive := func(chID byte, msgBytes []byte) { onReceive := func(chID byte, msgBytes []byte) {
reactor := reactorsByCh[chID] reactor := reactorsByCh[chID]
if reactor == nil { if reactor == nil {
cmn.PanicSanity(cmn.Fmt("Unknown channel %X", chID)) onPeerError(p, fmt.Errorf("Unknown channel %X", chID))
} }
reactor.Receive(chID, p, msgBytes) reactor.Receive(chID, p, msgBytes)
} }