1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 05:52:20 +08:00

AddrManager: use addr manager with smarter TTLs

This addr manager should seriously help with the addrsplosion
problem.
This commit is contained in:
Juan Batiz-Benet
2015-02-02 11:30:00 -08:00
parent 8b98c8fbdc
commit e908effb4b
28 changed files with 184 additions and 386 deletions

View File

@ -476,16 +476,12 @@ func startListening(ctx context.Context, host p2phost.Host, cfg *config.Config)
return err
}
// explicitly set these as our listen addrs.
// (why not do it inside inet.NewNetwork? because this way we can
// listen on addresses without necessarily advertising those publicly.)
// list out our addresses
addrs, err := host.Network().InterfaceListenAddresses()
if err != nil {
return debugerror.Wrap(err)
}
log.Infof("Swarm listening at: %s", addrs)
host.Peerstore().AddAddresses(host.ID(), addrs)
return nil
}