//NodesForGet returns nodes which has datfile cache , and that extends nodes to #searchDepth . func NodesForGet(datfile string, searchDepth int) node.Slice { var ns, ns2 node.Slice ns = ns.Extend(Get(datfile, nil)) ns = ns.Extend(Get(list, nil)) ns = ns.Extend(Random(ns, 0)) for _, n := range ns { if !n.Equals(node.Me(true)) && n.IsAllowed() { ns2 = append(ns2, n) } } if ns2.Len() > searchDepth { ns2 = ns2[:searchDepth] } return ns2 }