remove timeout confirming payment sent/received & revert state on error

This commit is contained in:
woodser 2024-04-19 14:30:55 -04:00
parent 0ead6d8f83
commit 5c0d9a1ae5
2 changed files with 6 additions and 4 deletions

View file

@ -140,9 +140,10 @@ public class BuyerProtocol extends DisputeProtocol {
handleTaskRunnerSuccess(event);
},
(errorMessage) -> {
log.warn("Error confirming payment sent, reverting state to {}, error={}", Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN, errorMessage);
trade.setState(Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN);
handleTaskRunnerFault(event, errorMessage);
}))
.withTimeout(TradeProtocol.TRADE_TIMEOUT_SECONDS))
})))
.run(() -> trade.advanceState(Trade.State.BUYER_CONFIRMED_PAYMENT_SENT))
.executeTasks(true);
} catch (Exception e) {

View file

@ -136,9 +136,10 @@ public class SellerProtocol extends DisputeProtocol {
handleTaskRunnerSuccess(event);
resultHandler.handleResult();
}, (errorMessage) -> {
log.warn("Error confirming payment received, reverting state to {}, error={}", Trade.State.BUYER_SENT_PAYMENT_SENT_MSG, errorMessage);
trade.setState(Trade.State.BUYER_SENT_PAYMENT_SENT_MSG);
handleTaskRunnerFault(event, errorMessage);
}))
.withTimeout(TradeProtocol.TRADE_TIMEOUT_SECONDS))
})))
.run(() -> trade.advanceState(Trade.State.SELLER_CONFIRMED_PAYMENT_RECEIPT))
.executeTasks(true);
} catch (Exception e) {