Search in sources :

Example 1 with MailboxMessage

use of bisq.network.p2p.MailboxMessage in project bisq-core by bisq-network.

the class SellerAsMakerProtocol method doApplyMailboxMessage.

// /////////////////////////////////////////////////////////////////////////////////////////
// Mailbox
// /////////////////////////////////////////////////////////////////////////////////////////
@Override
public void doApplyMailboxMessage(NetworkEnvelope networkEnvelop, Trade trade) {
    this.trade = trade;
    NodeAddress peerNodeAddress = ((MailboxMessage) networkEnvelop).getSenderNodeAddress();
    if (networkEnvelop instanceof DepositTxPublishedMessage)
        handle((DepositTxPublishedMessage) networkEnvelop, peerNodeAddress);
    else if (networkEnvelop instanceof CounterCurrencyTransferStartedMessage)
        handle((CounterCurrencyTransferStartedMessage) networkEnvelop, peerNodeAddress);
    else
        log.error("We received an unhandled MailboxMessage" + networkEnvelop.toString());
}
Also used : CounterCurrencyTransferStartedMessage(bisq.core.trade.messages.CounterCurrencyTransferStartedMessage) SellerProcessCounterCurrencyTransferStartedMessage(bisq.core.trade.protocol.tasks.seller.SellerProcessCounterCurrencyTransferStartedMessage) MakerProcessDepositTxPublishedMessage(bisq.core.trade.protocol.tasks.maker.MakerProcessDepositTxPublishedMessage) DepositTxPublishedMessage(bisq.core.trade.messages.DepositTxPublishedMessage) NodeAddress(bisq.network.p2p.NodeAddress) MailboxMessage(bisq.network.p2p.MailboxMessage)

Example 2 with MailboxMessage

use of bisq.network.p2p.MailboxMessage in project bisq-core by bisq-network.

the class SellerAsTakerProtocol method doApplyMailboxMessage.

// /////////////////////////////////////////////////////////////////////////////////////////
// Mailbox
// /////////////////////////////////////////////////////////////////////////////////////////
@Override
public void doApplyMailboxMessage(NetworkEnvelope networkEnvelop, Trade trade) {
    this.trade = trade;
    if (networkEnvelop instanceof MailboxMessage) {
        NodeAddress peerNodeAddress = ((MailboxMessage) networkEnvelop).getSenderNodeAddress();
        if (networkEnvelop instanceof PublishDepositTxRequest)
            handle((PublishDepositTxRequest) networkEnvelop, peerNodeAddress);
        else if (networkEnvelop instanceof CounterCurrencyTransferStartedMessage)
            handle((CounterCurrencyTransferStartedMessage) networkEnvelop, peerNodeAddress);
        else
            log.error("We received an unhandled MailboxMessage" + networkEnvelop.toString());
    }
}
Also used : CounterCurrencyTransferStartedMessage(bisq.core.trade.messages.CounterCurrencyTransferStartedMessage) SellerProcessCounterCurrencyTransferStartedMessage(bisq.core.trade.protocol.tasks.seller.SellerProcessCounterCurrencyTransferStartedMessage) NodeAddress(bisq.network.p2p.NodeAddress) MailboxMessage(bisq.network.p2p.MailboxMessage) TakerProcessPublishDepositTxRequest(bisq.core.trade.protocol.tasks.taker.TakerProcessPublishDepositTxRequest) PublishDepositTxRequest(bisq.core.trade.messages.PublishDepositTxRequest)

Example 3 with MailboxMessage

use of bisq.network.p2p.MailboxMessage in project bisq-core by bisq-network.

the class BuyerAsMakerProtocol method doApplyMailboxMessage.

// /////////////////////////////////////////////////////////////////////////////////////////
// Mailbox
// /////////////////////////////////////////////////////////////////////////////////////////
@Override
public void doApplyMailboxMessage(NetworkEnvelope networkEnvelop, Trade trade) {
    this.trade = trade;
    if (networkEnvelop instanceof MailboxMessage) {
        MailboxMessage mailboxMessage = (MailboxMessage) networkEnvelop;
        NodeAddress peerNodeAddress = mailboxMessage.getSenderNodeAddress();
        if (networkEnvelop instanceof DepositTxPublishedMessage)
            handle((DepositTxPublishedMessage) networkEnvelop, peerNodeAddress);
        else if (networkEnvelop instanceof PayoutTxPublishedMessage)
            handle((PayoutTxPublishedMessage) networkEnvelop, peerNodeAddress);
        else
            log.error("We received an unhandled MailboxMessage" + networkEnvelop.toString());
    }
}
Also used : MakerProcessDepositTxPublishedMessage(bisq.core.trade.protocol.tasks.maker.MakerProcessDepositTxPublishedMessage) DepositTxPublishedMessage(bisq.core.trade.messages.DepositTxPublishedMessage) PayoutTxPublishedMessage(bisq.core.trade.messages.PayoutTxPublishedMessage) BuyerProcessPayoutTxPublishedMessage(bisq.core.trade.protocol.tasks.buyer.BuyerProcessPayoutTxPublishedMessage) NodeAddress(bisq.network.p2p.NodeAddress) MailboxMessage(bisq.network.p2p.MailboxMessage)

Example 4 with MailboxMessage

use of bisq.network.p2p.MailboxMessage in project bisq-core by bisq-network.

the class BuyerAsTakerProtocol method doApplyMailboxMessage.

// /////////////////////////////////////////////////////////////////////////////////////////
// Mailbox
// /////////////////////////////////////////////////////////////////////////////////////////
@Override
public void doApplyMailboxMessage(NetworkEnvelope networkEnvelop, Trade trade) {
    this.trade = trade;
    final NodeAddress senderNodeAddress = ((MailboxMessage) networkEnvelop).getSenderNodeAddress();
    if (networkEnvelop instanceof PublishDepositTxRequest)
        handle((PublishDepositTxRequest) networkEnvelop, senderNodeAddress);
    else if (networkEnvelop instanceof PayoutTxPublishedMessage) {
        handle((PayoutTxPublishedMessage) networkEnvelop, senderNodeAddress);
    } else
        log.error("We received an unhandled MailboxMessage" + networkEnvelop.toString());
}
Also used : PayoutTxPublishedMessage(bisq.core.trade.messages.PayoutTxPublishedMessage) BuyerProcessPayoutTxPublishedMessage(bisq.core.trade.protocol.tasks.buyer.BuyerProcessPayoutTxPublishedMessage) NodeAddress(bisq.network.p2p.NodeAddress) MailboxMessage(bisq.network.p2p.MailboxMessage) TakerProcessPublishDepositTxRequest(bisq.core.trade.protocol.tasks.taker.TakerProcessPublishDepositTxRequest) PublishDepositTxRequest(bisq.core.trade.messages.PublishDepositTxRequest)

Aggregations

MailboxMessage (bisq.network.p2p.MailboxMessage)4 NodeAddress (bisq.network.p2p.NodeAddress)4 CounterCurrencyTransferStartedMessage (bisq.core.trade.messages.CounterCurrencyTransferStartedMessage)2 DepositTxPublishedMessage (bisq.core.trade.messages.DepositTxPublishedMessage)2 PayoutTxPublishedMessage (bisq.core.trade.messages.PayoutTxPublishedMessage)2 PublishDepositTxRequest (bisq.core.trade.messages.PublishDepositTxRequest)2 BuyerProcessPayoutTxPublishedMessage (bisq.core.trade.protocol.tasks.buyer.BuyerProcessPayoutTxPublishedMessage)2 MakerProcessDepositTxPublishedMessage (bisq.core.trade.protocol.tasks.maker.MakerProcessDepositTxPublishedMessage)2 SellerProcessCounterCurrencyTransferStartedMessage (bisq.core.trade.protocol.tasks.seller.SellerProcessCounterCurrencyTransferStartedMessage)2 TakerProcessPublishDepositTxRequest (bisq.core.trade.protocol.tasks.taker.TakerProcessPublishDepositTxRequest)2