From d8b08cd943be0ad097dae940c4c2e44a15b6047a Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Mon, 19 Mar 2018 13:19:05 +0300 Subject: [PATCH] return back panic in peer#onReceive Refs #1317 --- p2p/peer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/p2p/peer.go b/p2p/peer.go index e20271149..4af6eeaae 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -358,7 +358,9 @@ func createMConnection(conn net.Conn, p *peer, reactorsByCh map[byte]Reactor, ch onReceive := func(chID byte, msgBytes []byte) { reactor := reactorsByCh[chID] if reactor == nil { - onPeerError(p, fmt.Errorf("Unknown channel %X", chID)) + // Note that its ok to panic here as it's caught in the conn._recover, + // which does onPeerError. + panic(cmn.Fmt("Unknown channel %X", chID)) } reactor.Receive(chID, p, msgBytes) }