p2p listener should only log an error if not shutting down

This commit is contained in:
Olaoluwa Osuntokun 2016-04-24 12:40:23 -07:00
parent 0e607c1939
commit 1dfe344c4d

View File

@ -198,7 +198,11 @@ func (s *server) listener(l net.Listener) {
for atomic.LoadInt32(&s.shutdown) == 0 {
conn, err := l.Accept()
if err != nil {
srvrLog.Errorf("Can't accept connection: %v", err)
// Only log the error message if we aren't currently
// shutting down.
if atomic.LoadInt32(&s.shutdown) == 0 {
srvrLog.Errorf("Can't accept connection: %v", err)
}
continue
}