Add check that price is not 0.

Signed-off-by: HenrikJannsen <boilingfrog@gmx.com>
This commit is contained in:
HenrikJannsen 2024-05-08 17:13:33 +07:00
parent c6a8d82e64
commit 892db99dcb
No known key found for this signature in database
GPG key ID: 02AA2BAE387C8307

View file

@ -241,7 +241,7 @@ public class BurningManAccountingService implements DaoSetupService, DaoStateLis
Date month = balanceEntry.getMonth();
long receivedBtc = balanceEntry.getAmount();
Price price = averageBsqPriceByMonth.get(month);
if (price == null) {
if (price == null || price.getValue() == 0) {
return OptionalLong.empty();
}
long volume = price.getVolumeByAmount(Coin.valueOf(receivedBtc)).getValue();