diff --git a/beacon-chain/sync/rpc_goodbye.go b/beacon-chain/sync/rpc_goodbye.go index cda906204..0a0c83892 100644 --- a/beacon-chain/sync/rpc_goodbye.go +++ b/beacon-chain/sync/rpc_goodbye.go @@ -27,7 +27,10 @@ func (r *Service) goodbyeRPCHandler(ctx context.Context, msg interface{}, stream defer cancel() setRPCStreamDeadlines(stream) - m := msg.(uint64) + m, ok:= msg.(uint64) + if !ok { + return fmt.Errorf("wrong message type for goodbye, got %T, wanted uint64", msg) + } log := log.WithField("Reason", goodbyeMessage(m)) log.WithField("peer", stream.Conn().RemotePeer()).Info("Peer has sent a goodbye message") // closes all streams with the peer