diff --git a/service/default/http.go b/service/default/http.go index b2fa8ab..b09e70c 100644 --- a/service/default/http.go +++ b/service/default/http.go @@ -115,6 +115,10 @@ func (h *HTTPServiceDefault) p2pHandler(ctx jape.Context) { } } + if clientIP != nil { + peer.SetIP(&net.IPAddr{IP: clientIP}) + } + if blockConnection(peer.GetIP()) { err := peer.End() if err != nil { @@ -123,10 +127,6 @@ func (h *HTTPServiceDefault) p2pHandler(ctx jape.Context) { return } - if clientIP != nil { - peer.SetIP(&net.IPAddr{IP: clientIP}) - } - h.Services().P2P().ConnectionTracker().Add(1) go func() {