mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-25 07:27:18 +01:00
Add checks for state at handle CounterCurrencyTransferStartedMessage
Add ApplyFilter task
This commit is contained in:
parent
c7e0c51875
commit
4b7307e07f
2 changed files with 28 additions and 0 deletions
|
@ -174,6 +174,19 @@ public class SellerAsMakerProtocol extends TradeProtocol implements SellerProtoc
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void handle(CounterCurrencyTransferStartedMessage tradeMessage, NodeAddress sender) {
|
||||
if (trade.getPayoutTx() != null) {
|
||||
log.warn("We received a CounterCurrencyTransferStartedMessage but we have already created the payout tx " +
|
||||
"so we ignore the message. This can happen if the ACK message to the peer did not " +
|
||||
"arrive and the peer repeats sending us the message. We send another ACK msg.");
|
||||
sendAckMessage(tradeMessage, true, null);
|
||||
processModel.removeMailboxMessageAfterProcessing(trade);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isTradeInPhase(Trade.Phase.DEPOSIT_CONFIRMED, tradeMessage)) {
|
||||
return;
|
||||
}
|
||||
|
||||
processModel.setTradeMessage(tradeMessage);
|
||||
processModel.setTempTradingPeerNodeAddress(sender);
|
||||
|
||||
|
@ -184,6 +197,7 @@ public class SellerAsMakerProtocol extends TradeProtocol implements SellerProtoc
|
|||
taskRunner.addTasks(
|
||||
SellerProcessCounterCurrencyTransferStartedMessage.class,
|
||||
MakerVerifyTakerAccount.class,
|
||||
ApplyFilter.class,
|
||||
MakerVerifyTakerFeePayment.class
|
||||
);
|
||||
taskRunner.run();
|
||||
|
|
|
@ -173,6 +173,19 @@ public class SellerAsTakerProtocol extends TradeProtocol implements SellerProtoc
|
|||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void handle(CounterCurrencyTransferStartedMessage tradeMessage, NodeAddress sender) {
|
||||
if (trade.getPayoutTx() != null) {
|
||||
log.warn("We received a CounterCurrencyTransferStartedMessage but we have already created the payout tx " +
|
||||
"so we ignore the message. This can happen if the ACK message to the peer did not " +
|
||||
"arrive and the peer repeats sending us the message. We send another ACK msg.");
|
||||
sendAckMessage(tradeMessage, true, null);
|
||||
processModel.removeMailboxMessageAfterProcessing(trade);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isTradeInPhase(Trade.Phase.DEPOSIT_CONFIRMED, tradeMessage)) {
|
||||
return;
|
||||
}
|
||||
|
||||
processModel.setTradeMessage(tradeMessage);
|
||||
processModel.setTempTradingPeerNodeAddress(sender);
|
||||
|
||||
|
@ -183,6 +196,7 @@ public class SellerAsTakerProtocol extends TradeProtocol implements SellerProtoc
|
|||
taskRunner.addTasks(
|
||||
SellerProcessCounterCurrencyTransferStartedMessage.class,
|
||||
TakerVerifyMakerAccount.class,
|
||||
ApplyFilter.class,
|
||||
TakerVerifyMakerFeePayment.class
|
||||
);
|
||||
taskRunner.run();
|
||||
|
|
Loading…
Add table
Reference in a new issue