diff --git a/core/src/main/java/bisq/core/locale/CurrencyUtil.java b/core/src/main/java/bisq/core/locale/CurrencyUtil.java index c23eb213183..e94127cef1b 100644 --- a/core/src/main/java/bisq/core/locale/CurrencyUtil.java +++ b/core/src/main/java/bisq/core/locale/CurrencyUtil.java @@ -301,7 +301,6 @@ public static List getAllTransferwiseCurrencies() { new FiatCurrency("MAD"), new FiatCurrency("NPR"), new FiatCurrency("NZD"), - new FiatCurrency("NGN"), new FiatCurrency("NOK"), new FiatCurrency("PKR"), new FiatCurrency("PEN"), diff --git a/core/src/main/java/bisq/core/payment/PaymentAccount.java b/core/src/main/java/bisq/core/payment/PaymentAccount.java index b61b86d482b..a540641319d 100644 --- a/core/src/main/java/bisq/core/payment/PaymentAccount.java +++ b/core/src/main/java/bisq/core/payment/PaymentAccount.java @@ -97,12 +97,25 @@ public protobuf.PaymentAccount toProtoMessage() { } public static PaymentAccount fromProto(protobuf.PaymentAccount proto, CoreProtoResolver coreProtoResolver) { - PaymentAccount account = PaymentAccountFactory.getPaymentAccount(PaymentMethod.getPaymentMethodById(proto.getPaymentMethod().getId())); + String paymentMethodId = proto.getPaymentMethod().getId(); + List tradeCurrencies = proto.getTradeCurrenciesList().stream() + .map(TradeCurrency::fromProto) + .collect(Collectors.toList()); + + // We need to remove NGN for Transferwise + Optional ngnTwOptional = tradeCurrencies.stream() + .filter(e -> paymentMethodId.equals(PaymentMethod.TRANSFERWISE_ID)) + .filter(e -> e.getCode().equals("NGN")) + .findAny(); + // We cannot remove it in the stream as it would cause a concurrentModificationException + ngnTwOptional.ifPresent(tradeCurrencies::remove); + + PaymentAccount account = PaymentAccountFactory.getPaymentAccount(PaymentMethod.getPaymentMethodById(paymentMethodId)); account.getTradeCurrencies().clear(); account.setId(proto.getId()); account.setCreationDate(proto.getCreationDate()); account.setAccountName(proto.getAccountName()); - account.getTradeCurrencies().addAll(proto.getTradeCurrenciesList().stream().map(TradeCurrency::fromProto).collect(Collectors.toList())); + account.getTradeCurrencies().addAll(tradeCurrencies); account.setPaymentAccountPayload(coreProtoResolver.fromProto(proto.getPaymentAccountPayload())); if (proto.hasSelectedTradeCurrency())