mirror of https://github.com/m2049r/xmrwallet.git
setNode blocks => call it async (#604)
This commit is contained in:
parent
f7cef24a83
commit
4349907627
|
@ -439,18 +439,20 @@ public class LoginFragment extends Fragment implements WalletInfoAdapter.OnInter
|
|||
}
|
||||
Collections.sort(nodesToTest, NodeInfo.BestNodeComparator);
|
||||
NodeInfo bestNode = nodesToTest.get(0);
|
||||
if (bestNode.isValid())
|
||||
if (bestNode.isValid()) {
|
||||
activityCallback.setNode(bestNode);
|
||||
return bestNode;
|
||||
else
|
||||
} else {
|
||||
activityCallback.setNode(null);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(NodeInfo result) {
|
||||
if (!isAdded()) return;
|
||||
pbNode.setVisibility(View.INVISIBLE);
|
||||
llNode.setVisibility(View.VISIBLE);
|
||||
activityCallback.setNode(result);
|
||||
if (result != null) {
|
||||
Timber.d("found a good node %s", result.toString());
|
||||
showNode(result);
|
||||
|
|
Loading…
Reference in New Issue