mirror of
https://github.com/libp2p/go-libp2p.git
synced 2025-10-21 15:19:38 +08:00
Revert "Merge pull request #386 from libp2p/fix/correct-external-addr"
This reverts commitaca83b9b63
, reversing changes made to86b8929d4d
. This was is not the correct fix. We already expose these addresses via the host's AllAddrs method. The real problem is probably that we just don't ever tell anyone about them (unless we disconnect and reconnect to our nearby DHT nodes). We need an address gossip protocol.
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
lgbl "github.com/libp2p/go-libp2p-loggables"
|
||||
inat "github.com/libp2p/go-libp2p-nat"
|
||||
inet "github.com/libp2p/go-libp2p-net"
|
||||
pstore "github.com/libp2p/go-libp2p-peerstore"
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
)
|
||||
|
||||
@@ -188,9 +187,6 @@ func addPortMapping(nmgr *natManager, intaddr ma.Multiaddr) {
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: make these temporary and rediscover them.
|
||||
nmgr.net.Peerstore().AddAddr(nmgr.net.LocalPeer(), extaddr, pstore.PermanentAddrTTL)
|
||||
|
||||
lm["outcome"] = "success"
|
||||
lm["externalAddr"] = func() interface{} { return extaddr.String() }
|
||||
log.Infof("established nat port mapping: %s <--> %s", intaddr, extaddr)
|
||||
|
Reference in New Issue
Block a user