fix: set forwarded ip before checking for a blocked connection
This commit is contained in:
parent
3cce024829
commit
d2b2fa09e3
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue