More extensive choice of transferee

This commit is contained in:
Bryan Boreham committed 2015-11-03 12:03:28 +00:00
1 parent 27c5f5f49f
commit ace372cfc6
4 files changed
+45 -28

No files matched your search

+2 -2
View File
@@ -470,9 +470,9 @@ func (r *Ring) ChoosePeersToAskForSpace(start, end address.Address) []router.Pee
return result
}
func (r *Ring) PickPeerForTransfer() router.PeerName {
func (r *Ring) PickPeerForTransfer(isValid func(router.PeerName) bool) router.PeerName {
for _, entry := range r.Entries {
if entry.Peer != r.Peer {
if entry.Peer != r.Peer && isValid(entry.Peer) {
return entry.Peer
}
}