mirror of
https://github.com/libp2p/go-libp2p-resource-manager.git
synced 2025-03-10 17:20:39 +08:00
Fix comment
This commit is contained in:
parent
7ecf0fc714
commit
297cd00321
5
rcmgr.go
5
rcmgr.go
@ -571,7 +571,6 @@ func (s *connectionScope) transferAllowedToStandard() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *connectionScope) SetPeer(p peer.ID) error {
|
func (s *connectionScope) SetPeer(p peer.ID) error {
|
||||||
// TODO check if this connectionscope is part of the allowlist and do the peer checking if so.
|
|
||||||
s.Lock()
|
s.Lock()
|
||||||
defer s.Unlock()
|
defer s.Unlock()
|
||||||
|
|
||||||
@ -588,10 +587,10 @@ func (s *connectionScope) SetPeer(p peer.ID) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if s.isAllowlisted && !s.rcmgr.allowlist.AllowedPeerAndMultiaddr(p, s.endpoint) {
|
if s.isAllowlisted && !s.rcmgr.allowlist.AllowedPeerAndMultiaddr(p, s.endpoint) {
|
||||||
// This is not a allowed peer + multiaddr combination. We need to
|
// This is not an allowed peer + multiaddr combination. We need to
|
||||||
// transfer this connection to the general scope. We'll do this first by
|
// transfer this connection to the general scope. We'll do this first by
|
||||||
// transferring the connection to the system and transient scopes, then
|
// transferring the connection to the system and transient scopes, then
|
||||||
// continue on with this function. The idea is that a connection
|
// continue on with this function. The idea is that a connection
|
||||||
// shouldn't get the benefit of evading the transient scope because it
|
// shouldn't get the benefit of evading the transient scope because it
|
||||||
// was _almost_ an allowlisted connection.
|
// was _almost_ an allowlisted connection.
|
||||||
if err := s.transferAllowedToStandard(); err != nil {
|
if err := s.transferAllowedToStandard(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user