Commit 67aba4d5 authored by vyzo's avatar vyzo
Browse files

move relay selection strategy out of line

parent cc2dd220
......@@ -132,9 +132,7 @@ func (h *AutoRelayHost) findRelays(ctx context.Context) {
return
}
// TODO better relay selection strategy; this just selects random relays
// but we should probably use ping latency as the selection metric
shuffleRelays(pis)
pis = h.selectRelays(pis)
update := 0
......@@ -171,6 +169,13 @@ func (h *AutoRelayHost) findRelays(ctx context.Context) {
}
}
func (h *AutoRelayHost) selectRelays(pis []pstore.PeerInfo) []pstore.PeerInfo {
// TODO better relay selection strategy; this just selects random relays
// but we should probably use ping latency as the selection metric
shuffleRelays(pis)
return pis
}
func (h *AutoRelayHost) updateAddrs() {
h.doUpdateAddrs()
h.PushIdentify()
......
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