Skip to content

Commit

Permalink
config: add DefaultLoopbackAddressesOnLanDHT
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Apr 3, 2024
1 parent 2e44474 commit 8b0a7ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions config/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (
"runtime"
)

const (
DefaultLoopbackAddressesOnLanDHT = false
)

// Routing defines configuration options for libp2p routing.
type Routing struct {
// Type sets default daemon routing mode.
Expand Down
3 changes: 2 additions & 1 deletion core/node/libp2p/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/libp2p/go-libp2p/core/routing"
routedhost "github.com/libp2p/go-libp2p/p2p/host/routed"

"github.com/ipfs/kubo/config"
"github.com/ipfs/kubo/core/node/helpers"
"github.com/ipfs/kubo/repo"

Expand Down Expand Up @@ -60,7 +61,7 @@ func Host(mctx helpers.MetricsCtx, lc fx.Lifecycle, params P2PHostIn) (out P2PHo
BootstrapPeers: bootstrappers,
OptimisticProvide: cfg.Experimental.OptimisticProvide,
OptimisticProvideJobsPoolSize: cfg.Experimental.OptimisticProvideJobsPoolSize,
LoopbackAddressesOnLanDHT: cfg.Routing.LoopbackAddressesOnLanDHT.WithDefault(false),
LoopbackAddressesOnLanDHT: cfg.Routing.LoopbackAddressesOnLanDHT.WithDefault(config.DefaultLoopbackAddressesOnLanDHT),
}
opts = append(opts, libp2p.Routing(func(h host.Host) (routing.PeerRouting, error) {
args := routingOptArgs
Expand Down

0 comments on commit 8b0a7ed

Please sign in to comment.