feat: block pay invoice (#2727)

This commit is contained in:
Vlad Stan
2024-10-01 17:17:42 +03:00
committed by GitHub
parent e85a78854e
commit a58deff70c
7 changed files with 61 additions and 14 deletions
+3 -1
View File
@@ -491,8 +491,10 @@ async def check_time_limit_between_transactions(conn, wallet_id):
async def check_wallet_daily_withdraw_limit(conn, wallet_id, amount_msat):
limit = settings.lnbits_wallet_limit_daily_max_withdraw
if not limit or limit <= 0:
if not limit:
return
if limit < 0:
raise ValueError("It is not allowed to spend funds from this server.")
payments = await get_payments(
since=int(time.time()) - 60 * 60 * 24,