lnurlw: follow-up: adapt to recent lnworker.get_bolt11_invoice refactor
What changed, and why it matters
This is a routine code update that changes how two parts of Electrum's user interface call an internal Lightning invoice function. The old function signature was replaced with a newer one, so the code was adjusted to match. There is no indication this fixes or introduces a security issue.
No security action needed; treat as normal maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adapts lnurlw-related calls to a refactored lnworker.get_bolt11_invoice API. Previously the method accepted payment_hash, amount_msat, message, expiry, and fallback_address. After the refactor it accepts a payment_info object plus message and fallback_address. The patch updates electrum/gui/qml/qerequestdetails.py and electrum/gui/qt/send_tab.py to retrieve payment_info via lnworker.get_payment_info(req.payment_hash) and pass it as the new parameter. It also fixes a variable reference from self.wallet.wallet to self._wallet.wallet in the QML file.
Changed components
electrum/gui/qml/qerequestdetails.pyelectrum/gui/qt/send_tab.pyInspect captured patch +9 / −11
diff --git a/electrum/gui/qml/qerequestdetails.py b/electrum/gui/qml/qerequestdetails.py
index e12f463..d0d5f29 100644
--- a/electrum/gui/qml/qerequestdetails.py
+++ b/electrum/gui/qml/qerequestdetails.py
@@ -230,19 +230,18 @@ class QERequestDetails(QObject, QtEventListener):
self._logger.debug(f'requesting lnurlw: {repr(self._lnurlData)}')
try:
- key = self.wallet.wallet.create_request(
+ key = self._wallet.wallet.create_request(
amount_sat=amount_sat,
message=self._lnurlData.get('default_description', ''),
exp_delay=120,
address=None,
)
- req = self.wallet.wallet.get_request(key)
- _lnaddr, b11_invoice = self.wallet.wallet.lnworker.get_bolt11_invoice(
- payment_hash=req.payment_hash,
- amount_msat=req.get_amount_msat(),
+ req = self._wallet.wallet.get_request(key)
+ info = self._wallet.wallet.lnworker.get_payment_info(req.payment_hash)
+ _lnaddr, b11_invoice = self._wallet.wallet.lnworker.get_bolt11_invoice(
+ payment_info=info,
message=req.get_message(),
- expiry=req.exp,
- fallback_address=None
+ fallback_address=None,
)
except Exception as e:
self._logger.exception('')
diff --git a/electrum/gui/qt/send_tab.py b/electrum/gui/qt/send_tab.py
index 34745fe..dc1a05c 100644
--- a/electrum/gui/qt/send_tab.py
+++ b/electrum/gui/qt/send_tab.py
@@ -968,12 +968,11 @@ class SendTab(QWidget, MessageBoxMixin, Logger):
address=None,
)
req = self.wallet.get_request(key)
+ info = self.wallet.lnworker.get_payment_info(req.payment_hash)
_lnaddr, b11_invoice = self.wallet.lnworker.get_bolt11_invoice(
- payment_hash=req.payment_hash,
- amount_msat=req.get_amount_msat(),
+ payment_info=info,
message=req.get_message(),
- expiry=req.exp,
- fallback_address=None
+ fallback_address=None,
)
except Exception as e:
self.logger.exception('')
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.