use of iota.GOldDiggerLocalPoW in project isf-jclient by mikrohash.
the class NodeManager method connectToNode.
private static boolean connectToNode(final String node, final int api) {
TimeAbortCall t = new TimeAbortCall(R.STR.getString("nodes_action_connecting"), 1) {
@Override
public boolean onCall() {
String protocol = node.split(":")[0];
String host = node.split(":")[1].replace("//", "");
String port = node.split(":")[2];
apis[api] = (IotaAPI) new IotaAPI.Builder().protocol(protocol).host(host).port(port).localPoW(new GOldDiggerLocalPoW()).build();
return true;
}
};
if (!t.call(CONNECTING_DURATION_TOLERACE))
return false;
String isNodeSynced = isNodeSynced(api);
if (isNodeSynced != null)
uim.logDbg(String.format(R.STR.getString("nodes_action_changing"), buildNodeAddress(api), api, isNodeSynced));
return isNodeSynced == null;
}
Aggregations