request fee from mint

This commit is contained in:
callebtc
2022-10-05 22:26:57 +02:00
parent 16eb3cf6c5
commit 2d48c3116c
7 changed files with 44 additions and 17 deletions

View File

@@ -28,8 +28,10 @@ def async_unwrap(to_await):
return async_response[0]
def fee_reserve(amount_msat: int) -> int:
def fee_reserve(amount_msat: int, internal=False) -> int:
"""Function for calculating the Lightning fee reserve"""
if internal:
return 0
return max(
int(LIGHTNING_RESERVE_FEE_MIN), int(amount_msat * LIGHTNING_FEE_PERCENT / 100.0)
)