protocols skip resending payment sent/received if shut down

This commit is contained in:
woodser 2024-01-07 22:37:41 -05:00
parent 3173f20c4b
commit a6f6f5c00a
2 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,9 @@ public class BuyerProtocol extends DisputeProtocol {
protected void onInitialized() {
super.onInitialized();
// done if shut down
if (trade.isShutDown()) return;
// re-send payment sent message if not acked
synchronized (trade) {
if (trade.getState().ordinal() >= Trade.State.BUYER_SENT_PAYMENT_SENT_MSG.ordinal() && trade.getState().ordinal() < Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG.ordinal()) {

View File

@ -50,6 +50,9 @@ public class SellerProtocol extends DisputeProtocol {
protected void onInitialized() {
super.onInitialized();
// done if shut down
if (trade.isShutDown()) return;
// re-send payment received message if payout not published
synchronized (trade) {
if (trade.getState().ordinal() >= Trade.State.SELLER_SENT_PAYMENT_RECEIVED_MSG.ordinal() && !trade.isPayoutPublished()) {