From c22606023efb405ed550bcce022a02477841e83e Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Mon, 22 Jan 2024 16:28:08 +0000 Subject: [PATCH] Fix devfund fraction validation --- api/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/tasks.py b/api/tasks.py index aa8afe187..09ac9f5ac 100644 --- a/api/tasks.py +++ b/api/tasks.py @@ -104,7 +104,7 @@ def send_devfund_donation(order_id, proceeds, reason): order = Order.objects.get(id=order_id) coordinator_alias = config("COORDINATOR_ALIAS", cast=str, default="NoAlias") - donation_fraction = max(0.05, config("DEVFUND", cast=float, default=0.2)) + donation_fraction = min(1.0, max(0.00, config("DEVFUND", cast=float, default=0.2))) message = f"Devfund donation; {coordinator_alias}; {order}; {donation_fraction}; {reason};" num_satoshis = int(proceeds * donation_fraction) routing_budget_sats = int(max(5, num_satoshis * 0.000_1))