Use preferredTradeCurrency is fiat, otherwise the users country currency

This commit is contained in:
chimp1984 2020-12-07 13:48:43 -05:00
parent a7765d0cce
commit 249c6143c9
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3

View file

@ -292,10 +292,14 @@ public class OfferUtil {
public Optional<Volume> getFeeInUserFiatCurrency(Coin makerFee,
boolean isCurrencyForMakerFeeBtc,
CoinFormatter bsqFormatter) {
// We use the users currency derived from his selected country. We don't use the
// preferredTradeCurrency from preferences as that can be also set to an altcoin.
String countryCode = preferences.getUserCountry().code;
String userCurrencyCode = CurrencyUtil.getCurrencyByCountryCode(countryCode).getCode();
String userCurrencyCode = preferences.getPreferredTradeCurrency().getCode();
if (CurrencyUtil.isCryptoCurrency(userCurrencyCode)) {
// In case the user has selected a altcoin as preferredTradeCurrency
// we derive the fiat currency from the user country
String countryCode = preferences.getUserCountry().code;
userCurrencyCode = CurrencyUtil.getCurrencyByCountryCode(countryCode).getCode();
}
return getFeeInUserFiatCurrency(makerFee,
isCurrencyForMakerFeeBtc,
userCurrencyCode,