mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Add more requestPersistence for data changes in ProcessModel and TradingPeer
This commit is contained in:
parent
9517f427b6
commit
255460e5d5
@ -204,9 +204,9 @@ public final class MediationManager extends DisputeManager<MediationDisputeList>
|
||||
trade.getDisputeState() == Trade.DisputeState.MEDIATION_STARTED_BY_PEER) {
|
||||
trade.getProcessModel().setBuyerPayoutAmountFromMediation(disputeResult.getBuyerPayoutAmount().value);
|
||||
trade.getProcessModel().setSellerPayoutAmountFromMediation(disputeResult.getSellerPayoutAmount().value);
|
||||
tradeManager.requestPersistence();
|
||||
|
||||
trade.setDisputeState(Trade.DisputeState.MEDIATION_CLOSED);
|
||||
|
||||
tradeManager.requestPersistence();
|
||||
}
|
||||
} else {
|
||||
|
@ -433,6 +433,7 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi
|
||||
|
||||
((TakerProtocol) tradeProtocol).onTakeOffer();
|
||||
tradeResultHandler.handleResult(trade);
|
||||
requestPersistence();
|
||||
}
|
||||
},
|
||||
errorMessageHandler);
|
||||
|
@ -65,6 +65,7 @@ public class BuyerAsTakerProtocol extends BuyerProtocol implements TakerProtocol
|
||||
|
||||
Offer offer = checkNotNull(trade.getOffer());
|
||||
processModel.getTradingPeer().setPubKeyRing(offer.getPubKeyRing());
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
}
|
||||
|
||||
|
||||
@ -83,7 +84,10 @@ public class BuyerAsTakerProtocol extends BuyerProtocol implements TakerProtocol
|
||||
BuyerAsTakerCreatesDepositTxInputs.class,
|
||||
TakerSendInputsForDepositTxRequest.class)
|
||||
.withTimeout(30))
|
||||
.run(() -> processModel.setTempTradingPeerNodeAddress(trade.getTradingPeerNodeAddress()))
|
||||
.run(() -> {
|
||||
processModel.setTempTradingPeerNodeAddress(trade.getTradingPeerNodeAddress());
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
})
|
||||
.executeTasks();
|
||||
}
|
||||
|
||||
|
@ -99,11 +99,13 @@ public class FluentProtocol {
|
||||
NodeAddress peer = condition.getPeer();
|
||||
if (peer != null) {
|
||||
tradeProtocol.processModel.setTempTradingPeerNodeAddress(peer);
|
||||
tradeProtocol.processModel.getTradeManager().requestPersistence();
|
||||
}
|
||||
|
||||
TradeMessage message = condition.getMessage();
|
||||
if (message != null) {
|
||||
tradeProtocol.processModel.setTradeMessage(message);
|
||||
tradeProtocol.processModel.getTradeManager().requestPersistence();
|
||||
}
|
||||
|
||||
TradeTaskRunner taskRunner = setup.getTaskRunner(message, condition.getEvent());
|
||||
|
@ -294,6 +294,7 @@ public class ProcessModel implements Model, PersistablePayload {
|
||||
|
||||
public void setPaymentStartedMessageState(MessageState paymentStartedMessageStateProperty) {
|
||||
this.paymentStartedMessageStateProperty.set(paymentStartedMessageStateProperty);
|
||||
tradeManager.requestPersistence();
|
||||
}
|
||||
|
||||
void setDepositTxSentAckMessage(AckMessage ackMessage) {
|
||||
@ -305,6 +306,7 @@ public class ProcessModel implements Model, PersistablePayload {
|
||||
|
||||
public void setDepositTxMessageState(MessageState messageState) {
|
||||
this.depositTxMessageStateProperty.set(messageState);
|
||||
tradeManager.requestPersistence();
|
||||
}
|
||||
|
||||
void witnessDebugLog(Trade trade) {
|
||||
|
@ -59,6 +59,7 @@ public class SellerAsTakerProtocol extends SellerProtocol implements TakerProtoc
|
||||
super(trade);
|
||||
Offer offer = checkNotNull(trade.getOffer());
|
||||
processModel.getTradingPeer().setPubKeyRing(offer.getPubKeyRing());
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
}
|
||||
|
||||
|
||||
|
@ -81,6 +81,8 @@ public class BuyerSignPayoutTx extends TradeTask {
|
||||
sellerMultiSigPubKey);
|
||||
processModel.setPayoutTxSignature(payoutTxSignature);
|
||||
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
|
||||
complete();
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
|
@ -69,6 +69,8 @@ public class BuyerSignsDelayedPayoutTx extends TradeTask {
|
||||
sellerMultiSigPubKey);
|
||||
processModel.setDelayedPayoutTxSignature(delayedPayoutTxSignature);
|
||||
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
|
||||
complete();
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
|
@ -97,6 +97,8 @@ public class BuyerAsMakerCreatesAndSignsDepositTx extends TradeTask {
|
||||
processModel.setPreparedDepositTx(result.depositTransaction);
|
||||
processModel.setRawTransactionInputs(result.rawMakerInputs);
|
||||
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
|
||||
complete();
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
|
@ -53,6 +53,8 @@ public class BuyerAsTakerCreatesDepositTxInputs extends TradeTask {
|
||||
processModel.setChangeOutputValue(result.changeOutputValue);
|
||||
processModel.setChangeOutputAddress(result.changeOutputAddress);
|
||||
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
|
||||
complete();
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
|
@ -99,6 +99,8 @@ public class SignMediatedPayoutTx extends TradeTask {
|
||||
sellerMultiSigPubKey);
|
||||
processModel.setMediatedPayoutTxSignature(mediatedPayoutTxSignature);
|
||||
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
|
||||
complete();
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
|
@ -56,6 +56,8 @@ public class SellerCreatesDelayedPayoutTx extends TradeTask {
|
||||
|
||||
processModel.setPreparedDelayedPayoutTx(preparedDelayedPayoutTx);
|
||||
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
|
||||
complete();
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
|
@ -70,6 +70,8 @@ public class SellerSignsDelayedPayoutTx extends TradeTask {
|
||||
|
||||
processModel.setDelayedPayoutTxSignature(delayedPayoutTxSignature);
|
||||
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
|
||||
complete();
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
|
@ -57,6 +57,8 @@ public class SellerAsTakerCreatesDepositTxInputs extends TradeTask {
|
||||
processModel.setChangeOutputValue(result.changeOutputValue);
|
||||
processModel.setChangeOutputAddress(result.changeOutputAddress);
|
||||
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
|
||||
complete();
|
||||
} catch (Throwable t) {
|
||||
failed(t);
|
||||
|
@ -100,6 +100,9 @@ public class CreateTakerFeeTx extends TradeTask {
|
||||
|
||||
processModel.setTakeOfferFeeTx(transaction);
|
||||
walletService.swapTradeEntryToAvailableEntry(id, AddressEntry.Context.OFFER_FUNDING);
|
||||
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
|
||||
complete();
|
||||
} catch (Throwable t) {
|
||||
if (t instanceof DaoDisabledException) {
|
||||
|
@ -129,6 +129,9 @@ public class TakerSendInputsForDepositTxRequest extends TradeTask {
|
||||
log.info("Send {} with offerId {} and uid {} to peer {}",
|
||||
request.getClass().getSimpleName(), request.getTradeId(),
|
||||
request.getUid(), trade.getTradingPeerNodeAddress());
|
||||
|
||||
processModel.getTradeManager().requestPersistence();
|
||||
|
||||
processModel.getP2PService().sendEncryptedDirectMessage(
|
||||
trade.getTradingPeerNodeAddress(),
|
||||
processModel.getTradingPeer().getPubKeyRing(),
|
||||
|
Loading…
Reference in New Issue
Block a user