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