What changed, and why it matters
This commit simply removes an unused feature called 'full withdraw' or 'drain funds' from the LNbits wallet UI and backend model. There is no security issue visible in the change itself; it is a cleanup that deletes dead code and an associated QR-code menu option.
No security action required; treat as routine code cleanup. Reviewers may verify that the removed feature is genuinely unused and that no other code references lnurlwithdraw_full.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes the Wallet.lnurlwithdraw_full property (which encoded a /withdraw LNURL for the wallet) and removes the corresponding ‘drain_funds’ expansion item from the wallet HTML template. Imports that were only used by the removed property (lnurl_encode and url_for) are also removed. No logic is altered and no vulnerability is introduced or fixed by this diff.
Changed components
lnbits/core/models/wallets.pylnbits/core/templates/core/wallet.htmlInspect captured patch +0 / −31
diff --git a/lnbits/core/models/wallets.py b/lnbits/core/models/wallets.py
index 96fb56b..2b0ae63 100644
--- a/lnbits/core/models/wallets.py
+++ b/lnbits/core/models/wallets.py
@@ -4,12 +4,10 @@ from dataclasses import dataclass
from datetime import datetime, timezone
from enum import Enum
-from lnurl import encode as lnurl_encode
from pydantic import BaseModel, Field
from lnbits.core.models.lnurl import StoredPayLinks
from lnbits.db import FilterModel
-from lnbits.helpers import url_for
from lnbits.settings import settings
@@ -196,14 +194,6 @@ class Wallet(BaseModel):
def withdrawable_balance(self) -> int:
return self.balance_msat - settings.fee_reserve(self.balance_msat)
- @property
- def lnurlwithdraw_full(self) -> str:
- url = url_for("/withdraw", external=True, usr=self.user, wal=self.id)
- try:
- return lnurl_encode(url)
- except Exception:
- return ""
-
@property
def is_lightning_wallet(self) -> bool:
return self.wallet_type == WalletType.LIGHTNING.value
diff --git a/lnbits/core/templates/core/wallet.html b/lnbits/core/templates/core/wallet.html
index deae3eb..69a4381 100644
--- a/lnbits/core/templates/core/wallet.html
+++ b/lnbits/core/templates/core/wallet.html
@@ -239,27 +239,6 @@
<q-separator></q-separator>
<q-list>
- {% if wallet.lnurlwithdraw_full %}
- <q-expansion-item
- group="extras"
- icon="crop_free"
- :label="$t('drain_funds')"
- >
- <q-card>
- <q-card-section>
- <lnbits-qrcode
- value="lightning:{{wallet.lnurlwithdraw_full}}"
- href="lightning:{{wallet.lnurlwithdraw_full}}"
- ></lnbits-qrcode>
- <p
- class="text-center"
- v-text="$t('drain_funds_desc')"
- ></p>
- </q-card-section>
- </q-card>
- </q-expansion-item>
- <q-separator></q-separator>
- {% endif %}
<q-expansion-item
group="extras"
icon="qr_code"
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.