Disabled Jack
I'd love to use Java 8 features, but Jack just isn't ready yet.
This commit is contained in:
@ -92,23 +92,26 @@ public class ProofOfWorkService extends Service {
|
||||
}
|
||||
|
||||
private void calculateNonce(final PowItem item) {
|
||||
engine.calculateNonce(item.initialHash, item.targetValue, (initialHash, nonce) -> {
|
||||
try {
|
||||
item.callback.onNonceCalculated(initialHash, nonce);
|
||||
} finally {
|
||||
PowItem next;
|
||||
synchronized (queue) {
|
||||
next = queue.poll();
|
||||
if (next == null) {
|
||||
calculating = false;
|
||||
stopForeground(true);
|
||||
stopSelf();
|
||||
} else {
|
||||
notification.update(queue.size()).show();
|
||||
engine.calculateNonce(item.initialHash, item.targetValue, new ProofOfWorkEngine.Callback() {
|
||||
@Override
|
||||
public void onNonceCalculated(byte[] initialHash, byte[] nonce) {
|
||||
try {
|
||||
item.callback.onNonceCalculated(initialHash, nonce);
|
||||
} finally {
|
||||
PowItem next;
|
||||
synchronized (queue) {
|
||||
next = queue.poll();
|
||||
if (next == null) {
|
||||
calculating = false;
|
||||
stopForeground(true);
|
||||
stopSelf();
|
||||
} else {
|
||||
notification.update(queue.size()).show();
|
||||
}
|
||||
}
|
||||
if (next != null) {
|
||||
calculateNonce(next);
|
||||
}
|
||||
}
|
||||
if (next != null) {
|
||||
calculateNonce(next);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -110,9 +110,9 @@ public class Singleton {
|
||||
return powRepo;
|
||||
}
|
||||
|
||||
public static BitmessageAddress getIdentity(Context ctx) {
|
||||
public static BitmessageAddress getIdentity(final Context ctx) {
|
||||
if (identity == null) {
|
||||
BitmessageContext bmc = getBitmessageContext(ctx);
|
||||
final BitmessageContext bmc = getBitmessageContext(ctx);
|
||||
synchronized (Singleton.class) {
|
||||
if (identity == null) {
|
||||
List<BitmessageAddress> identities = bmc.addresses()
|
||||
|
Reference in New Issue
Block a user