Search in sources :

Example 1 with NetworkEnvelope

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();
}
Also used : DisputeMessage(bisq.core.arbitration.messages.DisputeMessage) OpenNewDisputeMessage(bisq.core.arbitration.messages.OpenNewDisputeMessage) PeerOpenedDisputeMessage(bisq.core.arbitration.messages.PeerOpenedDisputeMessage) NetworkEnvelope(bisq.common.proto.network.NetworkEnvelope)

Example 2 with NetworkEnvelope

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");
        }
    }
}
Also used : NetworkEnvelope(bisq.common.proto.network.NetworkEnvelope)

Aggregations

NetworkEnvelope (bisq.common.proto.network.NetworkEnvelope)2 DisputeMessage (bisq.core.arbitration.messages.DisputeMessage)1 OpenNewDisputeMessage (bisq.core.arbitration.messages.OpenNewDisputeMessage)1 PeerOpenedDisputeMessage (bisq.core.arbitration.messages.PeerOpenedDisputeMessage)1