Revert "Merge pull request #386 from libp2p/fix/correct-external-addr"

This reverts commit aca83b9b63, reversing
changes made to 86b8929d4d.

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:
Steven Allen
2018-08-13 16:52:49 -07:00
parent 163d7d40dd
commit c83318bf08

View File

@@ -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)