use of io.bitsquare.p2p.messaging.MailboxMessage in project bitsquare by bitsquare.
the class BuyerAsOffererProtocol method doApplyMailboxMessage.
///////////////////////////////////////////////////////////////////////////////////////////
// Mailbox
///////////////////////////////////////////////////////////////////////////////////////////
@Override
public void doApplyMailboxMessage(Message message, Trade trade) {
this.trade = trade;
if (message instanceof MailboxMessage) {
MailboxMessage mailboxMessage = (MailboxMessage) message;
NodeAddress peerNodeAddress = mailboxMessage.getSenderNodeAddress();
if (message instanceof FinalizePayoutTxRequest) {
handle((FinalizePayoutTxRequest) message, peerNodeAddress);
} else if (message instanceof DepositTxPublishedMessage) {
handle((DepositTxPublishedMessage) message, peerNodeAddress);
}
}
}
use of io.bitsquare.p2p.messaging.MailboxMessage in project bitsquare by bitsquare.
the class TradeTask method removeMailboxMessageAfterProcessing.
protected void removeMailboxMessageAfterProcessing() {
if (processModel.getTradeMessage() instanceof MailboxMessage) {
DecryptedMsgWithPubKey mailboxMessage = trade.getMailboxMessage();
if (mailboxMessage != null && mailboxMessage.message.equals(processModel.getTradeMessage())) {
log.debug("Remove mailboxMessage from P2P network. mailboxMessage = " + mailboxMessage);
processModel.getP2PService().removeEntryFromMailbox(mailboxMessage);
trade.setMailboxMessage(null);
}
}
}
use of io.bitsquare.p2p.messaging.MailboxMessage in project bitsquare by bitsquare.
the class SellerAsOffererProtocol method doApplyMailboxMessage.
///////////////////////////////////////////////////////////////////////////////////////////
// Mailbox
///////////////////////////////////////////////////////////////////////////////////////////
@Override
public void doApplyMailboxMessage(Message message, Trade trade) {
this.trade = trade;
NodeAddress peerNodeAddress = ((MailboxMessage) message).getSenderNodeAddress();
if (message instanceof PayoutTxFinalizedMessage) {
handle((PayoutTxFinalizedMessage) message, peerNodeAddress);
} else {
if (message instanceof FiatTransferStartedMessage) {
handle((FiatTransferStartedMessage) message, peerNodeAddress);
} else if (message instanceof DepositTxPublishedMessage) {
handle((DepositTxPublishedMessage) message, peerNodeAddress);
}
}
}
Aggregations