fix: timing logic for time between withdraws (#63)
This commit is contained in:
parent
8efacf2d4c
commit
d0689b7859
2 changed files with 3 additions and 3 deletions
2
crud.py
2
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:
|
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)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue