use of bisq.core.arbitration.messages.PeerPublishedDisputePayoutTxMessage in project bisq-core by bisq-network.
the class DisputeManager method sendPeerPublishedPayoutTxMessage.
// winner (or buyer in case of 50/50) sends tx to other peer
private void sendPeerPublishedPayoutTxMessage(Transaction transaction, Dispute dispute, Contract contract) {
PubKeyRing peersPubKeyRing = dispute.isDisputeOpenerIsBuyer() ? contract.getSellerPubKeyRing() : contract.getBuyerPubKeyRing();
NodeAddress peerNodeAddress = dispute.isDisputeOpenerIsBuyer() ? contract.getSellerNodeAddress() : contract.getBuyerNodeAddress();
log.trace("sendPeerPublishedPayoutTxMessage to peerAddress " + peerNodeAddress);
final PeerPublishedDisputePayoutTxMessage message = new PeerPublishedDisputePayoutTxMessage(transaction.bitcoinSerialize(), dispute.getTradeId(), p2PService.getAddress(), UUID.randomUUID().toString());
p2PService.sendEncryptedMailboxMessage(peerNodeAddress, peersPubKeyRing, message, new SendMailboxMessageListener() {
@Override
public void onArrived() {
log.info("Message arrived at peer. tradeId={}", message.getTradeId());
}
@Override
public void onStoredInMailbox() {
log.info("Message stored in mailbox. tradeId={}", message.getTradeId());
}
@Override
public void onFault(String errorMessage) {
log.error("sendEncryptedMailboxMessage failed. message=" + message);
}
});
}
Aggregations