update only buyer's payment sent message state property on startup

This commit is contained in:
woodser 2024-01-12 07:51:43 -05:00
parent bcb951ca40
commit 036ddef52c

View File

@ -694,11 +694,13 @@ public abstract class Trade implements Tradable, Model {
xmrWalletService.addWalletListener(idlePayoutSyncer); xmrWalletService.addWalletListener(idlePayoutSyncer);
} }
// TODO: trader's payment sent message state property can become unsynced (after improper shut down?) // TODO: buyer's payment sent message state property can become unsynced (after improper shut down?)
MessageState expectedState = getPaymentSentMessageState(); if (isBuyer()) {
if (!isArbitrator() && expectedState != null && expectedState != processModel.getPaymentSentMessageStateProperty().get()) { MessageState expectedState = getPaymentSentMessageState();
log.warn("Updating unexpected payment sent message state for {} {}, expected={}, actual={}", getClass().getSimpleName(), getId(), expectedState, processModel.getPaymentSentMessageStateProperty().get()); if (expectedState != null && expectedState != processModel.getPaymentSentMessageStateProperty().get()) {
processModel.getPaymentSentMessageStateProperty().set(expectedState); log.warn("Updating unexpected payment sent message state for {} {}, expected={}, actual={}", getClass().getSimpleName(), getId(), expectedState, processModel.getPaymentSentMessageStateProperty().get());
processModel.getPaymentSentMessageStateProperty().set(expectedState);
}
} }
// trade is initialized // trade is initialized