Commit a4eaa704 authored by Adin Schmahmann's avatar Adin Schmahmann Committed by Steven Allen

refreshing the routing table after the dht context is cancelled returns an error instead of hanging

parent 485c60a8
......@@ -248,6 +248,10 @@ func (dht *IpfsDHT) Bootstrap(_ context.Context) error {
// error and close. The channel is buffered and safe to ignore.
func (dht *IpfsDHT) RefreshRoutingTable() <-chan error {
res := make(chan error, 1)
dht.triggerRtRefresh <- res
select {
case dht.triggerRtRefresh <- res:
case <-dht.ctx.Done():
res <- dht.ctx.Err()
}
return res
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment