Fuse with if above
@@ -590,9 +590,8 @@ func (s *connectionScope) SetPeer(p peer.ID) error {
if s.isAllowlisted {
system = s.rcmgr.allowlistedSystem
transient = s.rcmgr.transient
- }
- if s.isAllowlisted && !s.rcmgr.allowlist.AllowedPeerAndMultiaddr(p, s.endpoint) {
+ if !s.rcmgr.allowlist.AllowedPeerAndMultiaddr(p, s.endpoint) {
// This is not an allowed peer + multiaddr combination. We need to
// transfer this connection to the general scope. We'll do this first by
// transferring the connection to the system and transient scopes, then
@@ -604,6 +603,7 @@ func (s *connectionScope) SetPeer(p peer.ID) error {
return err
}
}
+ }
s.peer = s.rcmgr.getPeerScope(p)
