mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Add check in case bsqPrice is 0 (thrown an exception otherwise)
This commit is contained in:
parent
63fc486896
commit
fae8ddad4b
1 changed files with 9 additions and 5 deletions
|
@ -373,11 +373,15 @@ public class OfferUtil {
|
||||||
tradeStatisticsManager,
|
tradeStatisticsManager,
|
||||||
30);
|
30);
|
||||||
Price bsqPrice = tuple.second;
|
Price bsqPrice = tuple.second;
|
||||||
String inputValue = bsqFormatter.formatCoin(makerFee);
|
if (bsqPrice.isPositive()) {
|
||||||
Volume makerFeeAsVolume = Volume.parse(inputValue, "BSQ");
|
String inputValue = bsqFormatter.formatCoin(makerFee);
|
||||||
Coin requiredBtc = bsqPrice.getAmountByVolume(makerFeeAsVolume);
|
Volume makerFeeAsVolume = Volume.parse(inputValue, "BSQ");
|
||||||
Volume volumeByAmount = userCurrencyPrice.getVolumeByAmount(requiredBtc);
|
Coin requiredBtc = bsqPrice.getAmountByVolume(makerFeeAsVolume);
|
||||||
return Optional.of(volumeByAmount);
|
Volume volumeByAmount = userCurrencyPrice.getVolumeByAmount(requiredBtc);
|
||||||
|
return Optional.of(volumeByAmount);
|
||||||
|
} else {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|
Loading…
Add table
Reference in a new issue