Remove delay form UserThread.execute

For tradeStateListener that would cause a wrong state as we would get
called after we have completed and do the isPayoutPublished check.
Keeping it in sync does remove the listener before we complete the
trade.

For autoConfirmSettings it would probably not cause and issue but as
we use a CopyOnWriteArrayList there the remove is safe anyway (to not
cause a ConcurrentListModification exception).
This commit is contained in:
chimp1984 2020-09-02 11:16:06 -05:00
parent 37241f98d8
commit d725590a9c
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3

View file

@ -25,7 +25,6 @@ import bisq.core.user.AutoConfirmSettings;
import bisq.network.Socks5ProxyProvider;
import bisq.common.UserThread;
import bisq.common.handlers.FaultHandler;
import org.bitcoinj.core.Coin;
@ -182,10 +181,10 @@ class XmrTxProofRequestsPerTrade implements AssetTxProofRequestsPerTrade {
requests.forEach(XmrTxProofRequest::terminate);
requests.clear();
if (tradeStateListener != null) {
UserThread.execute(() -> trade.stateProperty().removeListener(tradeStateListener));
trade.stateProperty().removeListener(tradeStateListener);
}
if (autoConfirmSettingsListener != null) {
UserThread.execute(() -> autoConfirmSettings.removeListener(autoConfirmSettingsListener));
autoConfirmSettings.removeListener(autoConfirmSettingsListener);
}
}