Skip to content

Commit ed4094d

Browse files
committed
rename to isInverted
1 parent 88d407f commit ed4094d

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

core/src/main/java/haveno/core/offer/Offer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,15 @@ public void cancelAvailabilityRequest() {
176176
public Price getPrice() {
177177
String counterCurrencyCode = getCounterCurrencyCode();
178178
if (!offerPayload.isUseMarketBasedPrice()) {
179-
return Price.valueOf(counterCurrencyCode, currenciesInverted() ? PriceUtil.invertLongPrice(offerPayload.getPrice(), counterCurrencyCode) : offerPayload.getPrice());
179+
return Price.valueOf(counterCurrencyCode, isInverted() ? PriceUtil.invertLongPrice(offerPayload.getPrice(), counterCurrencyCode) : offerPayload.getPrice());
180180
}
181181

182182
checkNotNull(priceFeedService, "priceFeed must not be null");
183183
MarketPrice marketPrice = priceFeedService.getMarketPrice(counterCurrencyCode);
184184
if (marketPrice != null && marketPrice.isRecentExternalPriceAvailable()) {
185185
double factor;
186186
double marketPriceMargin = offerPayload.getMarketPriceMarginPct();
187-
if (currenciesInverted()) { // legacy offers inverted crypto prices
187+
if (isInverted()) { // legacy offers inverted crypto prices
188188
factor = getDirection() == OfferDirection.SELL ?
189189
1 - marketPriceMargin : 1 + marketPriceMargin;
190190
} else {
@@ -509,16 +509,16 @@ public String getCountryCode() {
509509
}
510510

511511
public String getBaseCurrencyCode() {
512-
return currenciesInverted() ? offerPayload.getCounterCurrencyCode() : offerPayload.getBaseCurrencyCode(); // legacy offers inverted crypto
512+
return isInverted() ? offerPayload.getCounterCurrencyCode() : offerPayload.getBaseCurrencyCode(); // legacy offers inverted crypto
513513
}
514514

515515
public String getCounterCurrencyCode() {
516516
if (currencyCode != null) return currencyCode;
517-
currencyCode = currenciesInverted() ? offerPayload.getBaseCurrencyCode() : offerPayload.getCounterCurrencyCode(); // legacy offers inverted crypto
517+
currencyCode = isInverted() ? offerPayload.getBaseCurrencyCode() : offerPayload.getCounterCurrencyCode(); // legacy offers inverted crypto
518518
return currencyCode;
519519
}
520520

521-
public boolean currenciesInverted() {
521+
public boolean isInverted() {
522522
return !offerPayload.getBaseCurrencyCode().equals("XMR");
523523
}
524524

core/src/main/java/haveno/core/trade/Trade.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,9 +2361,7 @@ public BigInteger getReservedAmount() {
23612361
}
23622362

23632363
public Price getPrice() {
2364-
2365-
// return uninverted price
2366-
boolean isInverted = getOffer().currenciesInverted();
2364+
boolean isInverted = getOffer().isInverted(); // return uninverted price
23672365
return Price.valueOf(offer.getCounterCurrencyCode(), isInverted ? PriceUtil.invertLongPrice(price, offer.getCounterCurrencyCode()) : price);
23682366
}
23692367

0 commit comments

Comments
 (0)