rebalance: division by zero fix

this occurs if I don't have any transaction forward for a day
This commit is contained in:
Gálli Zoltán
2021-08-19 01:30:44 +02:00
committed by Michael Schmoock
parent 0b400559f9
commit 88bb8beacf

View File

@@ -705,7 +705,10 @@ def get_avg_forward_fees(plugin: Plugin, intervals):
# return average intermediate
for idx, i in enumerate(res):
res[idx] = fees[idx] / total[idx] * 10**6
if int(total[idx]) > 0:
res[idx] = fees[idx] / total[idx] * 10**6
else:
res[idx] = 0
return res