Avoid adding repeated nodes to the list of nodes in NetworkService.
This commit is contained in:
parent
e107c014f0
commit
3bdfb777bf
1 changed files with 6 additions and 2 deletions
|
@ -246,11 +246,15 @@ public class NetworkService extends Service {
|
||||||
nodeUrls.addAll(urlList);
|
nodeUrls.addAll(urlList);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adding the library-provided list of nodes second
|
// Adding the library-provided list of nodes that are not repeated
|
||||||
nodeUrls.addAll(Arrays.asList(Nodes.NODE_URLS));
|
for(String node : Nodes.NODE_URLS) {
|
||||||
|
if(!nodeUrls.contains(node))
|
||||||
|
nodeUrls.add(node);
|
||||||
|
}
|
||||||
|
|
||||||
// Feeding all node information to the NodeProvider instance
|
// Feeding all node information to the NodeProvider instance
|
||||||
for(String nodeUrl : nodeUrls){
|
for(String nodeUrl : nodeUrls){
|
||||||
|
Log.d(TAG, "NodeUrl: " + nodeUrl);
|
||||||
nodeProvider.addNode(new FullNode(nodeUrl));
|
nodeProvider.addNode(new FullNode(nodeUrl));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue