From 5c9a6b9ed6dd5b36ab8ed75c4f0c404921de08cb Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 9 Nov 2023 17:19:59 -0500 Subject: [PATCH] move redundant deposit tx from ProcessModel to getSelf().getDepositTx() --- .../main/java/haveno/core/trade/protocol/ProcessModel.java | 7 +------ .../trade/protocol/tasks/MaybeSendSignContractRequest.java | 3 +-- .../trade/protocol/tasks/ProcessSignContractRequest.java | 1 - .../trade/protocol/tasks/ProcessSignContractResponse.java | 4 ++-- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/haveno/core/trade/protocol/ProcessModel.java b/core/src/main/java/haveno/core/trade/protocol/ProcessModel.java index aae3b75b..4b9f8b4a 100644 --- a/core/src/main/java/haveno/core/trade/protocol/ProcessModel.java +++ b/core/src/main/java/haveno/core/trade/protocol/ProcessModel.java @@ -111,7 +111,7 @@ public class ProcessModel implements Model, PersistablePayload { // After successful verified we copy that over to the trade.tradePeerAddress @Nullable @Setter - private NodeAddress tempTradePeerNodeAddress; // TODO (woodser): remove entirely? + private NodeAddress tempTradePeerNodeAddress; // Added in v.1.1.6 @Nullable @@ -123,8 +123,6 @@ public class ProcessModel implements Model, PersistablePayload { private long sellerPayoutAmountFromMediation; // Added for XMR integration - @Getter - transient private MoneroTxWallet takeOfferFeeTx; // TODO (woodser): remove @Setter transient private TradeMessage tradeMessage; @Getter @@ -136,9 +134,6 @@ public class ProcessModel implements Model, PersistablePayload { transient private MoneroTxWallet reserveTx; @Getter @Setter - transient private MoneroTxWallet depositTxXmr; - @Getter - @Setter transient private MoneroTxWallet unsignedPayoutTx; @Nullable @Getter diff --git a/core/src/main/java/haveno/core/trade/protocol/tasks/MaybeSendSignContractRequest.java b/core/src/main/java/haveno/core/trade/protocol/tasks/MaybeSendSignContractRequest.java index 2694c023..7e4eb8ae 100644 --- a/core/src/main/java/haveno/core/trade/protocol/tasks/MaybeSendSignContractRequest.java +++ b/core/src/main/java/haveno/core/trade/protocol/tasks/MaybeSendSignContractRequest.java @@ -68,7 +68,7 @@ public class MaybeSendSignContractRequest extends TradeTask { } // skip if deposit tx already created - if (processModel.getDepositTxXmr() != null) { + if (trade.getSelf().getDepositTx() != null) { complete(); return; } @@ -90,7 +90,6 @@ public class MaybeSendSignContractRequest extends TradeTask { for (MoneroOutput input : depositTx.getInputs()) reservedKeyImages.add(input.getKeyImage().getHex()); // save process state - processModel.setDepositTxXmr(depositTx); // TODO: redundant with trade.getSelf().setDepositTx(), remove? trade.getSelf().setDepositTx(depositTx); trade.getSelf().setDepositTxHash(depositTx.getHash()); trade.getSelf().setDepositTxFee(depositTx.getFee()); diff --git a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessSignContractRequest.java b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessSignContractRequest.java index 13b6ad9b..8fc93df9 100644 --- a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessSignContractRequest.java +++ b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessSignContractRequest.java @@ -76,7 +76,6 @@ public class ProcessSignContractRequest extends TradeTask { } // sign contract only when both deposit txs hashes known - // TODO (woodser): remove makerDepositTxId and takerDepositTxId from Trade if (processModel.getMaker().getDepositTxHash() == null || processModel.getTaker().getDepositTxHash() == null) { complete(); return; diff --git a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessSignContractResponse.java b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessSignContractResponse.java index 8727f685..8b518a99 100644 --- a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessSignContractResponse.java +++ b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessSignContractResponse.java @@ -80,8 +80,8 @@ public class ProcessSignContractResponse extends TradeTask { Version.getP2PMessageVersion(), new Date().getTime(), trade.getSelf().getContractSignature(), - processModel.getDepositTxXmr().getFullHex(), - processModel.getDepositTxXmr().getKey(), + trade.getSelf().getDepositTx().getFullHex(), + trade.getSelf().getDepositTx().getKey(), trade.getSelf().getPaymentAccountKey()); // send request to arbitrator