mirror of
https://github.com/lightningd/plugins.git
synced 2026-08-16 13:00:58 +02:00
rebalance: division by zero fix
this occurs if I don't have any transaction forward for a day
This commit is contained in:
parent
0b400559f9
commit
88bb8beacf
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue