resend payment sent & received messages from trade thread on startup
This commit is contained in:
parent
bbec107dcc
commit
6f51d333ec
@ -55,8 +55,10 @@ public class BuyerProtocol extends DisputeProtocol {
|
||||
super.onInitialized();
|
||||
|
||||
// re-send payment sent message if not acked
|
||||
ThreadUtils.execute(() -> {
|
||||
if (trade.isShutDownStarted() || trade.isPayoutPublished()) return;
|
||||
synchronized (trade) {
|
||||
if (trade.isShutDownStarted()) return;
|
||||
if (trade.isShutDownStarted() || trade.isPayoutPublished()) return;
|
||||
if (trade.getState().ordinal() >= Trade.State.BUYER_SENT_PAYMENT_SENT_MSG.ordinal() && trade.getState().ordinal() < Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG.ordinal()) {
|
||||
latchTrade();
|
||||
given(anyPhase(Trade.Phase.PAYMENT_SENT)
|
||||
@ -76,6 +78,7 @@ public class BuyerProtocol extends DisputeProtocol {
|
||||
awaitTradeLatch();
|
||||
}
|
||||
}
|
||||
}, trade.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,8 +51,10 @@ public class SellerProtocol extends DisputeProtocol {
|
||||
super.onInitialized();
|
||||
|
||||
// re-send payment received message if payout not published
|
||||
ThreadUtils.execute(() -> {
|
||||
if (trade.isShutDownStarted() || trade.isPayoutPublished()) return;
|
||||
synchronized (trade) {
|
||||
if (trade.isShutDownStarted()) return;
|
||||
if (trade.isShutDownStarted() || trade.isPayoutPublished()) return;
|
||||
if (trade.getState().ordinal() >= Trade.State.SELLER_SENT_PAYMENT_RECEIVED_MSG.ordinal() && !trade.isPayoutPublished()) {
|
||||
latchTrade();
|
||||
given(anyPhase(Trade.Phase.PAYMENT_RECEIVED)
|
||||
@ -72,6 +74,7 @@ public class SellerProtocol extends DisputeProtocol {
|
||||
awaitTradeLatch();
|
||||
}
|
||||
}
|
||||
}, trade.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user