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,
|
||||
30);
|
||||
Price bsqPrice = tuple.second;
|
||||
String inputValue = bsqFormatter.formatCoin(makerFee);
|
||||
Volume makerFeeAsVolume = Volume.parse(inputValue, "BSQ");
|
||||
Coin requiredBtc = bsqPrice.getAmountByVolume(makerFeeAsVolume);
|
||||
Volume volumeByAmount = userCurrencyPrice.getVolumeByAmount(requiredBtc);
|
||||
return Optional.of(volumeByAmount);
|
||||
if (bsqPrice.isPositive()) {
|
||||
String inputValue = bsqFormatter.formatCoin(makerFee);
|
||||
Volume makerFeeAsVolume = Volume.parse(inputValue, "BSQ");
|
||||
Coin requiredBtc = bsqPrice.getAmountByVolume(makerFeeAsVolume);
|
||||
Volume volumeByAmount = userCurrencyPrice.getVolumeByAmount(requiredBtc);
|
||||
return Optional.of(volumeByAmount);
|
||||
} else {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return Optional.empty();
|
||||
|
|
Loading…
Add table
Reference in a new issue