Fix routing hint checks for rewards invoices

This commit is contained in:
Reckless_Satoshi 2023-01-14 04:38:27 -08:00
parent b7925ac5bc
commit 62ec832c2e
No known key found for this signature in database
GPG Key ID: 9C4585B561315571

View File

@ -1608,15 +1608,17 @@ class Logics:
num_satoshis = user.profile.earned_rewards
routing_budget = int(
routing_budget_sats = int(
max(
num_satoshis * float(config("PROPORTIONAL_ROUTING_FEE_LIMIT")),
float(config("MIN_FLAT_ROUTING_FEE_LIMIT_REWARD")),
)
) # 1000 ppm or 10 sats
routing_budget_ppm = (routing_budget_sats / float(num_satoshis)) * 1000000
reward_payout = LNNode.validate_ln_invoice(
invoice, num_satoshis, routing_budget
invoice, num_satoshis, routing_budget_ppm
)
if not reward_payout["valid"]: