fix: timing logic for time between withdraws (#63)

This commit is contained in:
Arc 2025-09-15 09:00:40 +01:00 committed by GitHub
commit d0689b7859
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -108,7 +108,7 @@ async def remove_unique_withdraw_link(link: WithdrawLink, unique_hash: str) -> N
async def increment_withdraw_link(link: WithdrawLink) -> None: async def increment_withdraw_link(link: WithdrawLink) -> None:
link.used = link.used + 1 link.used = link.used + 1
link.open_time = int(datetime.now().timestamp()) + link.wait_time link.open_time = int(datetime.now().timestamp())
await update_withdraw_link(link) await update_withdraw_link(link)

View file

@ -99,9 +99,9 @@ async def api_lnurl_callback(
now = int(datetime.now().timestamp()) now = int(datetime.now().timestamp())
if now < link.open_time: if now < link.open_time + link.wait_time:
return LnurlErrorResponse( return LnurlErrorResponse(
reason=f"wait link open_time {link.open_time - now} seconds." reason=f"Wait {link.open_time + link.wait_time - now} seconds."
) )
if not id_unique_hash and link.is_unique: if not id_unique_hash and link.is_unique: