Signed-off-by: Jakob Borg <[email protected]>
This commit is contained in:
Jakob Borg committed 2026-11-24 07:55:55 +01:00
1 parent 123a8549b1
commit 3d04cf99f2
2 files changed
+5

No files matched your search

+3
View File
@@ -77,6 +77,7 @@ type Options struct {
AdvertiseAddresses []string
Identity []byte
Server bool
Client bool
ValueDatastore ds.Batching
RoutingDatastore ds.Batching
MaxConnections int // Zero uses libp2p defaults.
@@ -234,6 +235,8 @@ func NewSyncthingDHT(options Options) (*DHT, error) {
mode := kad.ModeAuto
if options.Server {
mode = kad.ModeServer
} else if options.Client {
mode = kad.ModeClient
}
opts := []kad.Option{
+2
View File
@@ -22,6 +22,7 @@ import (
"github.com/syncthing/syncthing/internal/db"
"github.com/syncthing/syncthing/internal/dht"
"github.com/syncthing/syncthing/internal/slogutil"
"github.com/syncthing/syncthing/lib/build"
"github.com/syncthing/syncthing/lib/config"
"github.com/syncthing/syncthing/lib/connections/registry"
"github.com/syncthing/syncthing/lib/events"
@@ -279,6 +280,7 @@ func (m *manager) CommitConfiguration(_, to config.Configuration) (handled bool)
UDP: m.registry.UDP,
ListenAddresses: listenAddresses,
BootstrapPeers: bootstrapPeers,
Client: build.IsAndroid || build.IsIOS,
})
if err != nil {
slog.Warn("Failed to initialize peer-to-peer discovery", slogutil.Error(err))