diff --git a/core/src/main/java/haveno/core/trade/Contract.java b/core/src/main/java/haveno/core/trade/Contract.java index fd4bcb0d..b0950c55 100644 --- a/core/src/main/java/haveno/core/trade/Contract.java +++ b/core/src/main/java/haveno/core/trade/Contract.java @@ -263,7 +263,13 @@ public final class Contract implements NetworkPayload { // edits a contract json string public static String sanitizeContractAsJson(String contractAsJson) { - return contractAsJson; // TODO: anything to sanitize? + return contractAsJson + .replaceAll( + "\"takerPaymentAccountPayload\": \\{[^}]*}", + "\"takerPaymentAccountPayload\": null") + .replaceAll( + "\"makerPaymentAccountPayload\": \\{[^}]*}", + "\"makerPaymentAccountPayload\": null"); } public void printDiff(@Nullable String peersContractAsJson) { diff --git a/core/src/main/java/haveno/core/trade/TradeManager.java b/core/src/main/java/haveno/core/trade/TradeManager.java index 2dc15165..14f85318 100644 --- a/core/src/main/java/haveno/core/trade/TradeManager.java +++ b/core/src/main/java/haveno/core/trade/TradeManager.java @@ -888,13 +888,13 @@ public class TradeManager implements PersistedDataHost, DecryptedDirectMessageLi P2PService.getMyNodeAddress(), null); } - trade.getProcessModel().setUseSavingsWallet(useSavingsWallet); trade.getProcessModel().setFundsNeededForTrade(fundsNeededForTrade.longValueExact()); trade.getMaker().setPaymentAccountId(offer.getOfferPayload().getMakerPaymentAccountId()); trade.getMaker().setPubKeyRing(offer.getPubKeyRing()); trade.getSelf().setPubKeyRing(keyRing.getPubKeyRing()); trade.getSelf().setPaymentAccountId(paymentAccountId); + trade.getSelf().setPaymentMethodId(user.getPaymentAccount(paymentAccountId).getPaymentAccountPayload().getPaymentMethodId()); // initialize trade protocol TradeProtocol tradeProtocol = createTradeProtocol(trade); diff --git a/core/src/main/java/haveno/core/trade/protocol/tasks/TakerSendInitTradeRequestToArbitrator.java b/core/src/main/java/haveno/core/trade/protocol/tasks/TakerSendInitTradeRequestToArbitrator.java index 76c0ab90..b5a6e362 100644 --- a/core/src/main/java/haveno/core/trade/protocol/tasks/TakerSendInitTradeRequestToArbitrator.java +++ b/core/src/main/java/haveno/core/trade/protocol/tasks/TakerSendInitTradeRequestToArbitrator.java @@ -57,7 +57,7 @@ public class TakerSendInitTradeRequestToArbitrator extends TradeTask { offer.getId(), trade.getAmount().longValueExact(), trade.getPrice().getValue(), - offer.getOfferPayload().getPaymentMethodId(), + trade.getSelf().getPaymentMethodId(), trade.getMaker().getAccountId(), trade.getTaker().getAccountId(), trade.getMaker().getPaymentAccountId(), diff --git a/core/src/main/java/haveno/core/trade/protocol/tasks/TakerSendInitTradeRequestToMaker.java b/core/src/main/java/haveno/core/trade/protocol/tasks/TakerSendInitTradeRequestToMaker.java index 8f2957ea..c6315eb1 100644 --- a/core/src/main/java/haveno/core/trade/protocol/tasks/TakerSendInitTradeRequestToMaker.java +++ b/core/src/main/java/haveno/core/trade/protocol/tasks/TakerSendInitTradeRequestToMaker.java @@ -54,8 +54,6 @@ public class TakerSendInitTradeRequestToMaker extends TradeTask { User user = processModel.getUser(); P2PService p2PService = processModel.getP2PService(); XmrWalletService walletService = model.getXmrWalletService(); - String paymentAccountId = trade.getSelf().getPaymentAccountId(); - String paymentMethodId = user.getPaymentAccount(paymentAccountId).getPaymentAccountPayload().getPaymentMethodId(); String payoutAddress = walletService.getOrCreateAddressEntry(offer.getId(), XmrAddressEntry.Context.TRADE_PAYOUT).getAddressString(); // taker signs offer using offer id as nonce to avoid challenge protocol @@ -67,7 +65,7 @@ public class TakerSendInitTradeRequestToMaker extends TradeTask { offer.getId(), trade.getAmount().longValueExact(), trade.getPrice().getValue(), - paymentMethodId, + trade.getSelf().getPaymentMethodId(), null, user.getAccountId(), trade.getMaker().getPaymentAccountId(),