mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-25 15:29:38 +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) {
|
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.setTradeMessage(tradeMessage);
|
||||||
processModel.setTempTradingPeerNodeAddress(sender);
|
processModel.setTempTradingPeerNodeAddress(sender);
|
||||||
|
|
||||||
|
@ -184,6 +197,7 @@ public class SellerAsMakerProtocol extends TradeProtocol implements SellerProtoc
|
||||||
taskRunner.addTasks(
|
taskRunner.addTasks(
|
||||||
SellerProcessCounterCurrencyTransferStartedMessage.class,
|
SellerProcessCounterCurrencyTransferStartedMessage.class,
|
||||||
MakerVerifyTakerAccount.class,
|
MakerVerifyTakerAccount.class,
|
||||||
|
ApplyFilter.class,
|
||||||
MakerVerifyTakerFeePayment.class
|
MakerVerifyTakerFeePayment.class
|
||||||
);
|
);
|
||||||
taskRunner.run();
|
taskRunner.run();
|
||||||
|
|
|
@ -173,6 +173,19 @@ public class SellerAsTakerProtocol extends TradeProtocol implements SellerProtoc
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private void handle(CounterCurrencyTransferStartedMessage tradeMessage, NodeAddress sender) {
|
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.setTradeMessage(tradeMessage);
|
||||||
processModel.setTempTradingPeerNodeAddress(sender);
|
processModel.setTempTradingPeerNodeAddress(sender);
|
||||||
|
|
||||||
|
@ -183,6 +196,7 @@ public class SellerAsTakerProtocol extends TradeProtocol implements SellerProtoc
|
||||||
taskRunner.addTasks(
|
taskRunner.addTasks(
|
||||||
SellerProcessCounterCurrencyTransferStartedMessage.class,
|
SellerProcessCounterCurrencyTransferStartedMessage.class,
|
||||||
TakerVerifyMakerAccount.class,
|
TakerVerifyMakerAccount.class,
|
||||||
|
ApplyFilter.class,
|
||||||
TakerVerifyMakerFeePayment.class
|
TakerVerifyMakerFeePayment.class
|
||||||
);
|
);
|
||||||
taskRunner.run();
|
taskRunner.run();
|
||||||
|
|
Loading…
Add table
Reference in a new issue