mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-22 20:19:21 +00:00
do not reset offer address entries on error from desktop ui form
This commit is contained in:
parent
047f1a1c1f
commit
5c0f49d58f
3 changed files with 10 additions and 3 deletions
|
@ -284,6 +284,7 @@ public class CoreOffersService {
|
|||
useSavingsWallet,
|
||||
triggerPriceAsLong,
|
||||
reserveExactAmount,
|
||||
true,
|
||||
resultHandler::accept,
|
||||
errorMessageHandler);
|
||||
}
|
||||
|
|
|
@ -541,6 +541,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
|||
boolean useSavingsWallet,
|
||||
long triggerPrice,
|
||||
boolean reserveExactAmount,
|
||||
boolean resetAddressEntriesOnError,
|
||||
TransactionResultHandler resultHandler,
|
||||
ErrorMessageHandler errorMessageHandler) {
|
||||
|
||||
|
@ -559,7 +560,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
|||
}, (errorMessage) -> {
|
||||
if (!openOffer.isCanceled()) {
|
||||
log.warn("Error processing pending offer {}: {}", openOffer.getId(), errorMessage);
|
||||
doCancelOffer(openOffer);
|
||||
doCancelOffer(openOffer, resetAddressEntriesOnError);
|
||||
}
|
||||
latch.countDown();
|
||||
errorMessageHandler.handleErrorMessage(errorMessage);
|
||||
|
@ -715,14 +716,18 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
|||
}
|
||||
}
|
||||
|
||||
private void doCancelOffer(OpenOffer openOffer) {
|
||||
doCancelOffer(openOffer, true);
|
||||
}
|
||||
|
||||
// remove open offer which thaws its key images
|
||||
private void doCancelOffer(@NotNull OpenOffer openOffer) {
|
||||
private void doCancelOffer(@NotNull OpenOffer openOffer, boolean resetAddressEntries) {
|
||||
Offer offer = openOffer.getOffer();
|
||||
offer.setState(Offer.State.REMOVED);
|
||||
openOffer.setState(OpenOffer.State.CANCELED);
|
||||
removeOpenOffer(openOffer);
|
||||
closedTradableManager.add(openOffer); // TODO: don't add these to closed tradables?
|
||||
xmrWalletService.resetAddressEntriesForOpenOffer(offer.getId());
|
||||
if (resetAddressEntries) xmrWalletService.resetAddressEntriesForOpenOffer(offer.getId());
|
||||
requestPersistence();
|
||||
xmrWalletService.thawOutputs(offer.getOfferPayload().getReserveTxKeyImages());
|
||||
}
|
||||
|
|
|
@ -296,6 +296,7 @@ public abstract class MutableOfferDataModel extends OfferDataModel {
|
|||
useSavingsWallet,
|
||||
triggerPrice,
|
||||
reserveExactAmount,
|
||||
false, // desktop ui resets address entries on cancel
|
||||
resultHandler,
|
||||
errorMessageHandler);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue