mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-12-22 11:39:29 +00:00
release lock processing offers before callback
This commit is contained in:
parent
76f8f85487
commit
2e57e6197d
1 changed files with 7 additions and 7 deletions
|
@ -863,8 +863,8 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
TransactionResultHandler resultHandler, // TODO (woodser): transaction not needed with result handler
|
TransactionResultHandler resultHandler, // TODO (woodser): transaction not needed with result handler
|
||||||
ErrorMessageHandler errorMessageHandler) {
|
ErrorMessageHandler errorMessageHandler) {
|
||||||
ThreadUtils.execute(() -> {
|
ThreadUtils.execute(() -> {
|
||||||
|
List<String> errorMessages = new ArrayList<String>();
|
||||||
synchronized (processOffersLock) {
|
synchronized (processOffersLock) {
|
||||||
List<String> errorMessages = new ArrayList<String>();
|
|
||||||
List<OpenOffer> openOffers = getOpenOffers();
|
List<OpenOffer> openOffers = getOpenOffers();
|
||||||
for (OpenOffer pendingOffer : openOffers) {
|
for (OpenOffer pendingOffer : openOffers) {
|
||||||
if (pendingOffer.getState() != OpenOffer.State.PENDING) continue;
|
if (pendingOffer.getState() != OpenOffer.State.PENDING) continue;
|
||||||
|
@ -887,12 +887,12 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
|
||||||
});
|
});
|
||||||
HavenoUtils.awaitLatch(latch);
|
HavenoUtils.awaitLatch(latch);
|
||||||
}
|
}
|
||||||
requestPersistence();
|
}
|
||||||
if (errorMessages.isEmpty()) {
|
requestPersistence();
|
||||||
if (resultHandler != null) resultHandler.handleResult(null);
|
if (errorMessages.isEmpty()) {
|
||||||
} else {
|
if (resultHandler != null) resultHandler.handleResult(null);
|
||||||
if (errorMessageHandler != null) errorMessageHandler.handleErrorMessage(errorMessages.toString());
|
} else {
|
||||||
}
|
if (errorMessageHandler != null) errorMessageHandler.handleErrorMessage(errorMessages.toString());
|
||||||
}
|
}
|
||||||
}, THREAD_ID);
|
}, THREAD_ID);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue