Skip to content

Commit

Permalink
Fix devfund fraction validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Reckless-Satoshi committed Jan 22, 2024
1 parent 14c2917 commit c226060
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c226060

Please sign in to comment.