From f471578ad29d49156487990f852cb376337fa476 Mon Sep 17 00:00:00 2001 From: Arc Date: Sun, 14 Sep 2025 20:27:42 +0100 Subject: [PATCH 1/2] Restores timing logic --- crud.py | 2 +- views_lnurl.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crud.py b/crud.py index 7d79ccd..b914ae5 100644 --- a/crud.py +++ b/crud.py @@ -108,7 +108,7 @@ async def remove_unique_withdraw_link(link: WithdrawLink, unique_hash: str) -> N async def increment_withdraw_link(link: WithdrawLink) -> None: 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) diff --git a/views_lnurl.py b/views_lnurl.py index d62b21d..db6dc5f 100644 --- a/views_lnurl.py +++ b/views_lnurl.py @@ -99,7 +99,7 @@ async def api_lnurl_callback( now = int(datetime.now().timestamp()) - if now < link.open_time: + if now > link.open_time + link.wait_time: return LnurlErrorResponse( reason=f"wait link open_time {link.open_time - now} seconds." ) From bdba2383605ed2737a698cc0328324b1a13de5a4 Mon Sep 17 00:00:00 2001 From: Arc Date: Sun, 14 Sep 2025 20:44:14 +0100 Subject: [PATCH 2/2] tested, works --- views_lnurl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views_lnurl.py b/views_lnurl.py index db6dc5f..d1bba22 100644 --- a/views_lnurl.py +++ b/views_lnurl.py @@ -99,9 +99,9 @@ async def api_lnurl_callback( now = int(datetime.now().timestamp()) - if now > link.open_time + link.wait_time: + if now < link.open_time + link.wait_time: 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: