must import multisig hex on deposits confirmed or payment sent messages

This commit is contained in:
woodser 2023-04-26 09:49:09 -04:00
parent ab55f1f54a
commit 605253ef62
2 changed files with 6 additions and 14 deletions

View File

@ -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();

View File

@ -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();