Merge pull request #843 from filecoin-project/fix/hello-disconnect

Disconnect if hello fails
This commit is contained in:
Jakub Sztandera
2019-12-10 22:12:52 +01:00
committed by GitHub
+2 -1
View File
@@ -64,7 +64,8 @@ func (hs *Service) HandleStream(s inet.Stream) {
var hmsg Message
if err := cborutil.ReadCborRPC(s, &hmsg); err != nil {
log.Infow("failed to read hello message", "error", err)
log.Infow("failed to read hello message, diconnecting", "error", err)
s.Conn().Close()
return
}
arrived := time.Now()