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