diff --git a/pkg/topology/kademlia/kademlia.go b/pkg/topology/kademlia/kademlia.go index 277eeba331a..d019d374af8 100644 --- a/pkg/topology/kademlia/kademlia.go +++ b/pkg/topology/kademlia/kademlia.go @@ -13,6 +13,8 @@ import ( "math/big" "math/rand" "path/filepath" + "sort" + "strings" "sync" "time" @@ -135,6 +137,11 @@ func newKadOptions(o Options) kadOptions { LowWaterMark: defaultValInt(o.LowWaterMark, defaultLowWaterMark), } + // Prioritize QUIC transport connections over the others. + sort.Slice(ko.Bootnodes, func(i, j int) bool { + return strings.Contains(ko.Bootnodes[i].String(), "/quic") + }) + if ko.SaturationFunc == nil { ko.SaturationFunc = makeSaturationFunc(ko) }