@@ -99,7 +99,7 @@ func New(ctx context.Context, h host.Host, options ...opts.Option) (*IpfsDHT, er
9999 if err := cfg .Apply (append ([]opts.Option {opts .Defaults }, options ... )... ); err != nil {
100100 return nil , err
101101 }
102- dht := makeDHT (ctx , h , cfg .Datastore , cfg .Protocols , cfg .BucketSize )
102+ dht := makeDHT (ctx , h , cfg .Datastore , cfg .Protocols , cfg .BucketSize , cfg . RoutingTable . LatencyTolerance )
103103 dht .autoRefresh = cfg .RoutingTable .AutoRefresh
104104 dht .rtRefreshPeriod = cfg .RoutingTable .RefreshPeriod
105105 dht .rtRefreshQueryTimeout = cfg .RoutingTable .RefreshQueryTimeout
@@ -152,9 +152,9 @@ func NewDHTClient(ctx context.Context, h host.Host, dstore ds.Batching) *IpfsDHT
152152 return dht
153153}
154154
155- func makeDHT (ctx context.Context , h host.Host , dstore ds.Batching , protocols []protocol.ID , bucketSize int ) * IpfsDHT {
155+ func makeDHT (ctx context.Context , h host.Host , dstore ds.Batching , protocols []protocol.ID , bucketSize int , latency time. Duration ) * IpfsDHT {
156156 self := kb .ConvertPeerID (h .ID ())
157- rt := kb .NewRoutingTable (bucketSize , self , time . Minute , h .Peerstore ())
157+ rt := kb .NewRoutingTable (bucketSize , self , latency , h .Peerstore ())
158158 cmgr := h .ConnManager ()
159159
160160 rt .PeerAdded = func (p peer.ID ) {
0 commit comments