fee reserves cant be negative (#260)

This commit is contained in:
callebtc
2023-06-23 20:37:21 +02:00
committed by GitHub
parent ae4eb43b8e
commit 65ab8e8120

View File

@@ -51,5 +51,5 @@ def calculate_number_of_blank_outputs(fee_reserve_sat: int):
The formula ensures that any overpaid fees can be represented by the blank outputs,
see NUT-08 for details.
"""
assert fee_reserve_sat > 0, "Fee reserve has to be positive."
assert fee_reserve_sat >= 0, "Fee reserve can't be negative."
return max(math.ceil(math.log2(fee_reserve_sat)), 1)