fix jfx error on offer book added

This commit is contained in:
woodser 2022-08-31 10:32:23 -04:00
parent bdaa054c95
commit 3da228750f
4 changed files with 16 additions and 15 deletions

View file

@ -75,7 +75,6 @@ import lombok.Setter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
@ -725,6 +724,7 @@ public abstract class Trade implements Tradable, Model {
// gather relevant info // gather relevant info
XmrWalletService walletService = processModel.getProvider().getXmrWalletService(); XmrWalletService walletService = processModel.getProvider().getXmrWalletService();
MoneroWallet multisigWallet = walletService.getMultisigWallet(this.getId()); MoneroWallet multisigWallet = walletService.getMultisigWallet(this.getId());
if (multisigWallet.isMultisigImportNeeded()) throw new RuntimeException("Cannot create payout tx because multisig import is needed");
String sellerPayoutAddress = this.getSeller().getPayoutAddressString(); String sellerPayoutAddress = this.getSeller().getPayoutAddressString();
String buyerPayoutAddress = this.getBuyer().getPayoutAddressString(); String buyerPayoutAddress = this.getBuyer().getPayoutAddressString();
Preconditions.checkNotNull(sellerPayoutAddress, "Seller payout address must not be null"); Preconditions.checkNotNull(sellerPayoutAddress, "Seller payout address must not be null");

View file

@ -32,7 +32,7 @@ import bisq.desktop.util.CurrencyList;
import bisq.desktop.util.CurrencyListItem; import bisq.desktop.util.CurrencyListItem;
import bisq.desktop.util.DisplayUtils; import bisq.desktop.util.DisplayUtils;
import bisq.desktop.util.GUIUtil; import bisq.desktop.util.GUIUtil;
import bisq.common.UserThread;
import bisq.core.account.witness.AccountAgeWitnessService; import bisq.core.account.witness.AccountAgeWitnessService;
import bisq.core.locale.CurrencyUtil; import bisq.core.locale.CurrencyUtil;
import bisq.core.locale.GlobalSettings; import bisq.core.locale.GlobalSettings;
@ -125,6 +125,7 @@ class OfferBookChartViewModel extends ActivatableViewModel {
offerBookListItems = offerBook.getOfferBookListItems(); offerBookListItems = offerBook.getOfferBookListItems();
offerBookListItemsListener = c -> { offerBookListItemsListener = c -> {
UserThread.execute(() -> {
c.next(); c.next();
if (c.wasAdded() || c.wasRemoved()) { if (c.wasAdded() || c.wasRemoved()) {
ArrayList<OfferBookListItem> list = new ArrayList<>(c.getRemoved()); ArrayList<OfferBookListItem> list = new ArrayList<>(c.getRemoved());
@ -136,6 +137,7 @@ class OfferBookChartViewModel extends ActivatableViewModel {
} }
fillTradeCurrencies(); fillTradeCurrencies();
});
}; };
currenciesUpdatedListener = (observable, oldValue, newValue) -> { currenciesUpdatedListener = (observable, oldValue, newValue) -> {

View file

@ -22,7 +22,7 @@ import bisq.desktop.main.offer.offerbook.OfferBook;
import bisq.desktop.main.offer.offerbook.OfferBookListItem; import bisq.desktop.main.offer.offerbook.OfferBookListItem;
import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.util.GUIUtil; import bisq.desktop.util.GUIUtil;
import bisq.common.UserThread;
import bisq.core.locale.Res; import bisq.core.locale.Res;
import bisq.core.monetary.Altcoin; import bisq.core.monetary.Altcoin;
import bisq.core.monetary.Price; import bisq.core.monetary.Price;
@ -89,7 +89,7 @@ class SpreadViewModel extends ActivatableViewModel {
this.formatter = formatter; this.formatter = formatter;
includePaymentMethod = false; includePaymentMethod = false;
offerBookListItems = offerBook.getOfferBookListItems(); offerBookListItems = offerBook.getOfferBookListItems();
listChangeListener = c -> update(offerBookListItems); listChangeListener = c -> UserThread.execute(() -> update(offerBookListItems));
} }
public String getKeyColumnName() { public String getKeyColumnName() {

View file

@ -87,7 +87,6 @@ import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.Getter; import lombok.Getter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;