From 09fd8710b17e35433bf43a9ab9cc24ef190d6897 Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 18 Jul 2024 10:00:40 -0400 Subject: [PATCH] do not set offer state to pending after canceled --- core/src/main/java/haveno/core/offer/OpenOfferManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/haveno/core/offer/OpenOfferManager.java b/core/src/main/java/haveno/core/offer/OpenOfferManager.java index b100de41..4a4610d8 100644 --- a/core/src/main/java/haveno/core/offer/OpenOfferManager.java +++ b/core/src/main/java/haveno/core/offer/OpenOfferManager.java @@ -625,6 +625,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe log.info("Canceling open offer: {}", openOffer.getId()); if (!offersToBeEdited.containsKey(openOffer.getId())) { if (openOffer.isAvailable()) { + openOffer.setState(OpenOffer.State.CANCELED); offerBookService.removeOffer(openOffer.getOffer().getOfferPayload(), () -> { ThreadUtils.submitToPool(() -> { // TODO: this runs off thread and then shows popup when done. should show overlay spinner until done @@ -634,6 +635,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe }, errorMessageHandler); } else { + openOffer.setState(OpenOffer.State.CANCELED); ThreadUtils.submitToPool(() -> { doCancelOffer(openOffer); if (resultHandler != null) resultHandler.handleResult(); @@ -1082,7 +1084,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe openOffer.setSplitOutputTxFee(splitOutputTx.getFee().longValueExact()); openOffer.setScheduledTxHashes(Arrays.asList(splitOutputTx.getHash())); openOffer.setScheduledAmount(openOffer.getOffer().getAmountNeeded().toString()); - openOffer.setState(OpenOffer.State.PENDING); + if (!openOffer.isCanceled()) openOffer.setState(OpenOffer.State.PENDING); } private void scheduleWithEarliestTxs(List openOffers, OpenOffer openOffer) {