Fixed tests & bugs, removed Ack payload type (a GenericPayload is now used)
- SystemTest don't work yet, sending messages seems broken - ProofOfWorkService needs some work, the current solution is a hack (and might be the reason above tests are broken)
This commit is contained in:
@ -175,10 +175,13 @@ public class InternalContext {
|
||||
object.sign(from.getPrivateKey());
|
||||
}
|
||||
if (payload instanceof Msg && recipient.has(Pubkey.Feature.DOES_ACK)) {
|
||||
ObjectMessage ackMessage = ((Msg) payload).getPlaintext().getAckMessage();
|
||||
final ObjectMessage ackMessage = ((Msg) payload).getPlaintext().getAckMessage();
|
||||
cryptography.doProofOfWork(ackMessage, NETWORK_NONCE_TRIALS_PER_BYTE, NETWORK_EXTRA_BYTES, new ProofOfWorkEngine.Callback() {
|
||||
@Override
|
||||
public void onNonceCalculated(byte[] initialHash, byte[] nonce) {
|
||||
// FIXME: the message gets lost if calculation is cancelled
|
||||
// (e.g. by terminating the application)
|
||||
ackMessage.setNonce(nonce);
|
||||
object.encrypt(recipient.getPubkey());
|
||||
proofOfWorkService.doProofOfWork(recipient, object);
|
||||
}
|
||||
|
Reference in New Issue
Block a user