watchtower/wtserver/server: handle missed err case from read msg

This commit is contained in:
Conner Fromknecht 2019-01-15 19:46:04 -08:00
parent 4a2fb1b4d0
commit 45cfa65b47
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7

@ -191,6 +191,12 @@ func (s *Server) handleClient(peer Peer) {
defer s.removePeer(&id, peer.RemoteAddr())
msg, err := s.readMessage(peer)
if err != nil {
log.Errorf("Unable to read message from client %s@%s: %v",
id, peer.RemoteAddr(), err)
return
}
remoteInit, ok := msg.(*wtwire.Init)
if !ok {
log.Errorf("Client %s@%s did not send Init msg as first "+