Skip to content

Commit

Permalink
webrtc: remove incorrect call to ConnectionGater.InterceptAddrDial
Browse files Browse the repository at this point in the history
This function is called from the swarm, not from every individual
transport.
  • Loading branch information
marten-seemann committed Jun 6, 2023
1 parent f6d4e17 commit dbec3b6
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions p2p/transport/webrtc/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,8 @@ func (t *WebRTCTransport) Dial(ctx context.Context, remoteMultiaddr ma.Multiaddr
return conn, nil
}

func (t *WebRTCTransport) dial(
ctx context.Context,
scope network.ConnManagementScope,
remoteMultiaddr ma.Multiaddr,
p peer.ID,
) (tConn tpt.CapableConn, err error) {
func (t *WebRTCTransport) dial(ctx context.Context, scope network.ConnManagementScope, remoteMultiaddr ma.Multiaddr, p peer.ID) (tConn tpt.CapableConn, err error) {
fmt.Println(remoteMultiaddr)
var pc *webrtc.PeerConnection
defer func() {
if err != nil {
Expand Down Expand Up @@ -371,11 +367,6 @@ func (t *WebRTCTransport) dial(
return nil, err
}

// check with the gater if we can dial
if t.gater != nil && !t.gater.InterceptAddrDial(p, remoteMultiaddr) {
return nil, errors.New("not allowed to dial remote peer")
}

// we can only know the remote public key after the noise handshake,
// but need to set up the callbacks on the peerconnection
conn, err := newConnection(
Expand Down

0 comments on commit dbec3b6

Please sign in to comment.