use of bisq.common.proto.network.NetworkEnvelope in project bisq-core by bisq-network.
the class DisputeManager method applyMessages.
private void applyMessages() {
decryptedDirectMessageWithPubKeys.forEach(decryptedMessageWithPubKey -> {
NetworkEnvelope networkEnvelope = decryptedMessageWithPubKey.getNetworkEnvelope();
log.debug("decryptedDirectMessageWithPubKeys.message " + networkEnvelope);
if (networkEnvelope instanceof DisputeMessage)
dispatchMessage((DisputeMessage) networkEnvelope);
});
decryptedDirectMessageWithPubKeys.clear();
decryptedMailboxMessageWithPubKeys.forEach(decryptedMessageWithPubKey -> {
NetworkEnvelope networkEnvelope = decryptedMessageWithPubKey.getNetworkEnvelope();
log.debug("decryptedMessageWithPubKey.message " + networkEnvelope);
if (networkEnvelope instanceof DisputeMessage) {
dispatchMessage((DisputeMessage) networkEnvelope);
p2PService.removeEntryFromMailbox(decryptedMessageWithPubKey);
}
});
decryptedMailboxMessageWithPubKeys.clear();
}
use of bisq.common.proto.network.NetworkEnvelope in project bisq-core by bisq-network.
the class PrivateNotificationManager method handleMessage.
private void handleMessage(DecryptedMessageWithPubKey decryptedMessageWithPubKey, NodeAddress senderNodeAddress) {
this.decryptedMessageWithPubKey = decryptedMessageWithPubKey;
NetworkEnvelope networkEnvelop = decryptedMessageWithPubKey.getNetworkEnvelope();
if (networkEnvelop instanceof PrivateNotificationMessage) {
PrivateNotificationMessage privateNotificationMessage = (PrivateNotificationMessage) networkEnvelop;
log.trace("Received privateNotificationMessage: " + privateNotificationMessage);
if (privateNotificationMessage.getSenderNodeAddress().equals(senderNodeAddress)) {
final PrivateNotificationPayload privateNotification = privateNotificationMessage.getPrivateNotificationPayload();
if (verifySignature(privateNotification))
privateNotificationMessageProperty.set(privateNotification);
} else {
log.warn("Peer address not matching for privateNotificationMessage");
}
}
}
Aggregations