From 1d468187328dce72635b006437f83ea32a2b175c Mon Sep 17 00:00:00 2001 From: woodser Date: Thu, 23 Feb 2023 09:21:03 -0500 Subject: [PATCH] getMyOffers() does not require asset code --- core/src/main/java/bisq/core/api/CoreOffersService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/bisq/core/api/CoreOffersService.java b/core/src/main/java/bisq/core/api/CoreOffersService.java index d11688f114..28e775cd88 100644 --- a/core/src/main/java/bisq/core/api/CoreOffersService.java +++ b/core/src/main/java/bisq/core/api/CoreOffersService.java @@ -288,9 +288,11 @@ public class CoreOffersService { private boolean offerMatchesDirectionAndCurrency(Offer offer, String direction, String currencyCode) { - var offerOfWantedDirection = offer.getDirection().name().equalsIgnoreCase(direction); + if ("".equals(direction)) direction = null; + if ("".equals(currencyCode)) currencyCode = null; + var offerOfWantedDirection = direction == null || offer.getDirection().name().equalsIgnoreCase(direction); var counterAssetCode = isCryptoCurrency(currencyCode) ? offer.getOfferPayload().getBaseCurrencyCode() : offer.getOfferPayload().getCounterCurrencyCode(); // TODO: crypto pairs invert base and counter currencies - var offerInWantedCurrency = counterAssetCode.equalsIgnoreCase(currencyCode); + var offerInWantedCurrency = currencyCode == null || counterAssetCode.equalsIgnoreCase(currencyCode); return offerOfWantedDirection && offerInWantedCurrency; }