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);
|
||||
}
|
||||
|
||||
// Adding the library-provided list of nodes second
|
||||
nodeUrls.addAll(Arrays.asList(Nodes.NODE_URLS));
|
||||
// Adding the library-provided list of nodes that are not repeated
|
||||
for(String node : Nodes.NODE_URLS) {
|
||||
if(!nodeUrls.contains(node))
|
||||
nodeUrls.add(node);
|
||||
}
|
||||
|
||||
// Feeding all node information to the NodeProvider instance
|
||||
for(String nodeUrl : nodeUrls){
|
||||
Log.d(TAG, "NodeUrl: " + nodeUrl);
|
||||
nodeProvider.addNode(new FullNode(nodeUrl));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue