diff --git a/.env.example b/.env.example index a367bec6..37e62ce3 100644 --- a/.env.example +++ b/.env.example @@ -63,6 +63,9 @@ LNBITS_BACKEND_WALLET_CLASS=VoidWallet # VoidWallet is just a fallback that works without any actual Lightning capabilities, # just so you can see the UI before dealing with this file. +# Invoice expiry for LND, CLN, Eclair, LNbits funding sources +LIGHTNING_INVOICE_EXPIRY=600 + # Set one of these blocks depending on the wallet kind you chose above: # ClicheWallet diff --git a/lnbits/core/services.py b/lnbits/core/services.py index 44664513..ee750302 100644 --- a/lnbits/core/services.py +++ b/lnbits/core/services.py @@ -64,6 +64,7 @@ async def create_invoice( memo: str, description_hash: Optional[bytes] = None, unhashed_description: Optional[bytes] = None, + expiry: Optional[int] = None, extra: Optional[Dict] = None, webhook: Optional[str] = None, internal: Optional[bool] = False, @@ -79,6 +80,7 @@ async def create_invoice( memo=invoice_memo, description_hash=description_hash, unhashed_description=unhashed_description, + expiry=expiry or settings.lightning_invoice_expiry, ) if not ok: raise InvoiceFailure(error_message or "unexpected backend error.") diff --git a/lnbits/core/templates/admin/_tab_funding.html b/lnbits/core/templates/admin/_tab_funding.html index 3887e151..35349e38 100644 --- a/lnbits/core/templates/admin/_tab_funding.html +++ b/lnbits/core/templates/admin/_tab_funding.html @@ -16,7 +16,7 @@
Active Funding (Requires server restart)
@@ -30,28 +30,40 @@Fee reserve
-Invoice Expiry
+Fee reserve
+TopUp a wallet
+