mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Use TradeMailboxMessage as type for getMessage in SendMailboxMessageTask
This commit is contained in:
parent
3834785828
commit
36657f5532
@ -18,6 +18,7 @@
|
|||||||
package bisq.core.trade.protocol.tasks;
|
package bisq.core.trade.protocol.tasks;
|
||||||
|
|
||||||
import bisq.core.trade.Trade;
|
import bisq.core.trade.Trade;
|
||||||
|
import bisq.core.trade.messages.TradeMailboxMessage;
|
||||||
import bisq.core.trade.messages.TradeMessage;
|
import bisq.core.trade.messages.TradeMessage;
|
||||||
|
|
||||||
import bisq.network.p2p.NodeAddress;
|
import bisq.network.p2p.NodeAddress;
|
||||||
@ -33,7 +34,7 @@ public abstract class SendMailboxMessageTask extends TradeTask {
|
|||||||
super(taskHandler, trade);
|
super(taskHandler, trade);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract TradeMessage getMessage(String id);
|
protected abstract TradeMailboxMessage getMessage(String id);
|
||||||
|
|
||||||
protected abstract void setStateSent();
|
protected abstract void setStateSent();
|
||||||
|
|
||||||
@ -48,7 +49,7 @@ public abstract class SendMailboxMessageTask extends TradeTask {
|
|||||||
try {
|
try {
|
||||||
runInterceptHook();
|
runInterceptHook();
|
||||||
String id = processModel.getOfferId();
|
String id = processModel.getOfferId();
|
||||||
TradeMessage message = getMessage(id);
|
TradeMailboxMessage message = getMessage(id);
|
||||||
setStateSent();
|
setStateSent();
|
||||||
NodeAddress peersNodeAddress = trade.getTradingPeerNodeAddress();
|
NodeAddress peersNodeAddress = trade.getTradingPeerNodeAddress();
|
||||||
log.info("Send {} to peer {}. tradeId={}, uid={}",
|
log.info("Send {} to peer {}. tradeId={}, uid={}",
|
||||||
|
@ -19,7 +19,7 @@ package bisq.core.trade.protocol.tasks.arbitration;
|
|||||||
|
|
||||||
import bisq.core.trade.Trade;
|
import bisq.core.trade.Trade;
|
||||||
import bisq.core.trade.messages.PeerPublishedDelayedPayoutTxMessage;
|
import bisq.core.trade.messages.PeerPublishedDelayedPayoutTxMessage;
|
||||||
import bisq.core.trade.messages.TradeMessage;
|
import bisq.core.trade.messages.TradeMailboxMessage;
|
||||||
import bisq.core.trade.protocol.tasks.SendMailboxMessageTask;
|
import bisq.core.trade.protocol.tasks.SendMailboxMessageTask;
|
||||||
|
|
||||||
import bisq.common.taskrunner.TaskRunner;
|
import bisq.common.taskrunner.TaskRunner;
|
||||||
@ -36,7 +36,7 @@ public class SendPeerPublishedDelayedPayoutTxMessage extends SendMailboxMessageT
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TradeMessage getMessage(String id) {
|
protected TradeMailboxMessage getMessage(String id) {
|
||||||
return new PeerPublishedDelayedPayoutTxMessage(UUID.randomUUID().toString(),
|
return new PeerPublishedDelayedPayoutTxMessage(UUID.randomUUID().toString(),
|
||||||
trade.getId(),
|
trade.getId(),
|
||||||
trade.getTradingPeerNodeAddress());
|
trade.getTradingPeerNodeAddress());
|
||||||
|
@ -21,6 +21,7 @@ import bisq.core.btc.model.AddressEntry;
|
|||||||
import bisq.core.network.MessageState;
|
import bisq.core.network.MessageState;
|
||||||
import bisq.core.trade.Trade;
|
import bisq.core.trade.Trade;
|
||||||
import bisq.core.trade.messages.CounterCurrencyTransferStartedMessage;
|
import bisq.core.trade.messages.CounterCurrencyTransferStartedMessage;
|
||||||
|
import bisq.core.trade.messages.TradeMailboxMessage;
|
||||||
import bisq.core.trade.messages.TradeMessage;
|
import bisq.core.trade.messages.TradeMessage;
|
||||||
import bisq.core.trade.protocol.tasks.SendMailboxMessageTask;
|
import bisq.core.trade.protocol.tasks.SendMailboxMessageTask;
|
||||||
|
|
||||||
@ -57,7 +58,7 @@ public class BuyerSendCounterCurrencyTransferStartedMessage extends SendMailboxM
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TradeMessage getMessage(String tradeId) {
|
protected TradeMailboxMessage getMessage(String tradeId) {
|
||||||
if (message == null) {
|
if (message == null) {
|
||||||
AddressEntry payoutAddressEntry = processModel.getBtcWalletService().getOrCreateAddressEntry(tradeId,
|
AddressEntry payoutAddressEntry = processModel.getBtcWalletService().getOrCreateAddressEntry(tradeId,
|
||||||
AddressEntry.Context.TRADE_PAYOUT);
|
AddressEntry.Context.TRADE_PAYOUT);
|
||||||
|
@ -20,7 +20,7 @@ package bisq.core.trade.protocol.tasks.mediation;
|
|||||||
import bisq.core.support.dispute.mediation.MediationResultState;
|
import bisq.core.support.dispute.mediation.MediationResultState;
|
||||||
import bisq.core.trade.Trade;
|
import bisq.core.trade.Trade;
|
||||||
import bisq.core.trade.messages.MediatedPayoutTxPublishedMessage;
|
import bisq.core.trade.messages.MediatedPayoutTxPublishedMessage;
|
||||||
import bisq.core.trade.messages.TradeMessage;
|
import bisq.core.trade.messages.TradeMailboxMessage;
|
||||||
import bisq.core.trade.protocol.tasks.SendMailboxMessageTask;
|
import bisq.core.trade.protocol.tasks.SendMailboxMessageTask;
|
||||||
|
|
||||||
import bisq.common.taskrunner.TaskRunner;
|
import bisq.common.taskrunner.TaskRunner;
|
||||||
@ -41,7 +41,7 @@ public class SendMediatedPayoutTxPublishedMessage extends SendMailboxMessageTask
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TradeMessage getMessage(String id) {
|
protected TradeMailboxMessage getMessage(String id) {
|
||||||
Transaction payoutTx = checkNotNull(trade.getPayoutTx(), "trade.getPayoutTx() must not be null");
|
Transaction payoutTx = checkNotNull(trade.getPayoutTx(), "trade.getPayoutTx() must not be null");
|
||||||
return new MediatedPayoutTxPublishedMessage(
|
return new MediatedPayoutTxPublishedMessage(
|
||||||
id,
|
id,
|
||||||
|
@ -21,7 +21,7 @@ import bisq.core.account.sign.SignedWitness;
|
|||||||
import bisq.core.account.witness.AccountAgeWitnessService;
|
import bisq.core.account.witness.AccountAgeWitnessService;
|
||||||
import bisq.core.trade.Trade;
|
import bisq.core.trade.Trade;
|
||||||
import bisq.core.trade.messages.PayoutTxPublishedMessage;
|
import bisq.core.trade.messages.PayoutTxPublishedMessage;
|
||||||
import bisq.core.trade.messages.TradeMessage;
|
import bisq.core.trade.messages.TradeMailboxMessage;
|
||||||
import bisq.core.trade.protocol.tasks.SendMailboxMessageTask;
|
import bisq.core.trade.protocol.tasks.SendMailboxMessageTask;
|
||||||
|
|
||||||
import bisq.common.taskrunner.TaskRunner;
|
import bisq.common.taskrunner.TaskRunner;
|
||||||
@ -43,7 +43,7 @@ public class SellerSendPayoutTxPublishedMessage extends SendMailboxMessageTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TradeMessage getMessage(String id) {
|
protected TradeMailboxMessage getMessage(String id) {
|
||||||
Transaction payoutTx = checkNotNull(trade.getPayoutTx(), "trade.getPayoutTx() must not be null");
|
Transaction payoutTx = checkNotNull(trade.getPayoutTx(), "trade.getPayoutTx() must not be null");
|
||||||
|
|
||||||
AccountAgeWitnessService accountAgeWitnessService = processModel.getAccountAgeWitnessService();
|
AccountAgeWitnessService accountAgeWitnessService = processModel.getAccountAgeWitnessService();
|
||||||
|
@ -20,6 +20,7 @@ package bisq.core.trade.protocol.tasks.seller;
|
|||||||
import bisq.core.network.MessageState;
|
import bisq.core.network.MessageState;
|
||||||
import bisq.core.trade.Trade;
|
import bisq.core.trade.Trade;
|
||||||
import bisq.core.trade.messages.DepositTxAndDelayedPayoutTxMessage;
|
import bisq.core.trade.messages.DepositTxAndDelayedPayoutTxMessage;
|
||||||
|
import bisq.core.trade.messages.TradeMailboxMessage;
|
||||||
import bisq.core.trade.messages.TradeMessage;
|
import bisq.core.trade.messages.TradeMessage;
|
||||||
import bisq.core.trade.protocol.tasks.SendMailboxMessageTask;
|
import bisq.core.trade.protocol.tasks.SendMailboxMessageTask;
|
||||||
|
|
||||||
@ -56,7 +57,7 @@ public class SellerSendsDepositTxAndDelayedPayoutTxMessage extends SendMailboxMe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected TradeMessage getMessage(String tradeId) {
|
protected TradeMailboxMessage getMessage(String tradeId) {
|
||||||
if (message == null) {
|
if (message == null) {
|
||||||
// We do not use a real unique ID here as we want to be able to re-send the exact same message in case the
|
// We do not use a real unique ID here as we want to be able to re-send the exact same message in case the
|
||||||
// peer does not respond with an ACK msg in a certain time interval. To avoid that we get dangling mailbox
|
// peer does not respond with an ACK msg in a certain time interval. To avoid that we get dangling mailbox
|
||||||
|
Loading…
Reference in New Issue
Block a user