p2p: fix minor typo and remove fd parameter in checkInboundConn (#22547)

This commit is contained in:
Chen Quan 2021-03-24 20:18:29 +08:00 committed by GitHub
parent 5129cdc4f0
commit 15e6c27f8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -876,8 +876,8 @@ func (srv *Server) listenLoop() {
}
remoteIP := netutil.AddrIP(fd.RemoteAddr())
if err := srv.checkInboundConn(fd, remoteIP); err != nil {
srv.log.Debug("Rejected inbound connnection", "addr", fd.RemoteAddr(), "err", err)
if err := srv.checkInboundConn(remoteIP); err != nil {
srv.log.Debug("Rejected inbound connection", "addr", fd.RemoteAddr(), "err", err)
fd.Close()
slots <- struct{}{}
continue
@ -897,7 +897,7 @@ func (srv *Server) listenLoop() {
}
}
func (srv *Server) checkInboundConn(fd net.Conn, remoteIP net.IP) error {
func (srv *Server) checkInboundConn(remoteIP net.IP) error {
if remoteIP == nil {
return nil
}