Commit 633b04e5 authored by Łukasz Magiera's avatar Łukasz Magiera

p2p: remove redundant listener address check

License: MIT
Signed-off-by: default avatarŁukasz Magiera <magik6k@gmail.com>
parent a0ad8cfd
......@@ -2,7 +2,6 @@ package p2p
import (
"context"
"errors"
"time"
ma "gx/ipfs/QmWWQ2Txc2c6tqjsBpzg5Ar652cHPGNsQQp2SejkNmkUMb/go-multiaddr"
......@@ -29,13 +28,6 @@ type outboundListener struct {
// Dial creates new P2P stream to a remote listener
func (p2p *P2P) Dial(ctx context.Context, peer peer.ID, proto string, bindAddr ma.Multiaddr) (Listener, error) {
lnet, _, err := manet.DialArgs(bindAddr)
if err != nil {
return nil, err
}
switch lnet {
case "tcp", "tcp4", "tcp6":
maListener, err := manet.Listen(bindAddr)
if err != nil {
return nil, err
......@@ -54,9 +46,6 @@ func (p2p *P2P) Dial(ctx context.Context, peer peer.ID, proto string, bindAddr m
go listener.acceptConns()
return listener, nil
default:
return nil, errors.New("unsupported proto: " + lnet)
}
}
func (l *outboundListener) dial() (net.Stream, error) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment