From 605253ef62210eb5561066c94eebd6602f36bcbe Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 26 Apr 2023 09:49:09 -0400 Subject: [PATCH] must import multisig hex on deposits confirmed or payment sent messages --- .../tasks/ProcessDepositsConfirmedMessage.java | 13 +++++-------- .../protocol/tasks/ProcessPaymentSentMessage.java | 7 +------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessDepositsConfirmedMessage.java b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessDepositsConfirmedMessage.java index 3020f54d75..dde012fbe6 100644 --- a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessDepositsConfirmedMessage.java +++ b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessDepositsConfirmedMessage.java @@ -53,6 +53,9 @@ public class ProcessDepositsConfirmedMessage extends TradeTask { if (sender.getNodeAddress().equals(trade.getSeller().getNodeAddress()) && sender != trade.getSeller()) trade.getSeller().setNodeAddress(null); if (sender.getNodeAddress().equals(trade.getArbitrator().getNodeAddress()) && sender != trade.getArbitrator()) trade.getArbitrator().setNodeAddress(null); + // update multisig hex + sender.setUpdatedMultisigHex(request.getUpdatedMultisigHex()); + // decrypt seller payment account payload if key given if (request.getSellerPaymentAccountKey() != null && trade.getTradePeer().getPaymentAccountPayload() == null) { log.info(trade.getClass().getSimpleName() + " decrypting using seller payment account key"); @@ -60,14 +63,8 @@ public class ProcessDepositsConfirmedMessage extends TradeTask { } processModel.getTradeManager().requestPersistence(); // in case importing multisig hex fails - // update multisig hex - sender.setUpdatedMultisigHex(request.getUpdatedMultisigHex()); - try { - trade.importMultisigHex(); - } catch (Exception e) { - log.warn("Error importing multisig hex for {} {}: {}", trade.getClass().getSimpleName(), trade.getId(), e.getMessage()); - e.printStackTrace(); - } + // import multisig hex + trade.importMultisigHex(); // save wallet off thread new Thread(() -> trade.saveWallet()).start(); diff --git a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessPaymentSentMessage.java b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessPaymentSentMessage.java index 1379077b87..f34653a5e4 100644 --- a/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessPaymentSentMessage.java +++ b/core/src/main/java/haveno/core/trade/protocol/tasks/ProcessPaymentSentMessage.java @@ -62,12 +62,7 @@ public class ProcessPaymentSentMessage extends TradeTask { trade.requestPersistence(); // import multisig hex - try { - trade.importMultisigHex(); - } catch (Exception e) { - log.warn("Error importing multisig hex for {} {}: {}", trade.getClass().getSimpleName(), trade.getId(), e.getMessage()); - e.printStackTrace(); - } + trade.importMultisigHex(); // save wallet off thread new Thread(() -> trade.saveWallet()).start();