Skip to content

Commit

Permalink
Fix bootstrapping on connenction change
Browse files Browse the repository at this point in the history
  • Loading branch information
markwinter committed Sep 30, 2014
1 parent 9b4c0b3 commit 97f5308
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ public void onReceive(Context context, Intent intent) {
if (networkInfo != null && networkInfo.isConnected()) {
if (DhtNodes.ipv4.size() == 0) {
new DownloadNodes(context).execute();
ToxSingleton toxSingleton = ToxSingleton.getInstance();
// Bootstrap again
for (int i = 0; i < DhtNodes.ipv4.size(); i++) {
try {
toxSingleton.jTox.bootstrap(DhtNodes.ipv4.get(i), Integer.parseInt(DhtNodes.port.get(i)), DhtNodes.key.get(i));
} catch (Exception e) {
}
}

ToxSingleton toxSingleton = ToxSingleton.getInstance();
// Bootstrap again
for (int i = 0; i < DhtNodes.ipv4.size(); i++) {
try {
toxSingleton.jTox.bootstrap(DhtNodes.ipv4.get(i), Integer.parseInt(DhtNodes.port.get(i)), DhtNodes.key.get(i));
} catch (Exception e) {
}
}
}
Expand Down

0 comments on commit 97f5308

Please sign in to comment.