Skip to content

Commit

Permalink
Delete key when count==0
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed May 14, 2024
1 parent ccdf0e1 commit a1d135b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions p2p/host/resource-manager/conn_limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,8 @@ func (cl *connLimiter) rmConn(ip netip.Addr) {
continue
}
countsPerLimit[i][masked]--
if countsPerLimit[i][masked] == 0 {
delete(countsPerLimit[i], masked)
}
}
}

0 comments on commit a1d135b

Please sign in to comment.