[bisq-network/bisq] Java 10 support (#1660)

Manfred Karrer notifications at github.com
Tue Sep 18 17:03:55 UTC 2018


@ripcurlx 
There was a bug with SetupUtils.
`UserThread.execute(resultHandler::handleResult);` was removed in an earlier commit.

Should be:
```
Thread checkCryptoThread = new Thread() {
            @Override
            public void run() {
                try {
                    Thread.currentThread().setName("checkCryptoThread");
                    log.trace("Run crypto test");
                    // just use any simple dummy msg
                    Ping payload = new Ping(1, 1);
                    SealedAndSigned sealedAndSigned = EncryptionService.encryptHybridWithSignature(payload,
                            keyRing.getSignatureKeyPair(), keyRing.getPubKeyRing().getEncryptionPubKey());
                    DecryptedDataTuple tuple = encryptionService.decryptHybridWithSignature(sealedAndSigned,
                            keyRing.getEncryptionKeyPair().getPrivate());
                    if (tuple.getNetworkEnvelope() instanceof Ping &&
                            ((Ping) tuple.getNetworkEnvelope()).getNonce() == payload.getNonce() &&
                            ((Ping) tuple.getNetworkEnvelope()).getLastRoundTripTime() == payload.getLastRoundTripTime()) {
                        log.debug("Crypto test succeeded");

                        UserThread.execute(resultHandler::handleResult);
                    } else {
                        errorHandler.accept(new CryptoException("Payload not correct after decryption"));
                    }
                } catch (CryptoException | ProtobufferException e) {
                    log.error(e.toString());
                    e.printStackTrace();
                    errorHandler.accept(e);
                }
            }
        };
        checkCryptoThread.start();
    }
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/1660#issuecomment-422471614
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20180918/c859d876/attachment-0001.html>


More information about the bisq-github mailing list