qml: lnurlw: bind walletCanReceive to in-liquidity
What changed, and why it matters
This is a small user-interface fix in Electrum's mobile-style QML wallet. It makes the 'Withdraw' button correctly enable itself once Lightning channels finish connecting, if the user opened a withdrawal request dialog early. There is no indication this is a security fix; it appears to be a usability/bug-fix for a UI state not updating properly.
No security action required. Treat as a normal usability/UI fix during routine review.
Security signals we found
No security-relevant signals present in the diff or commit message
Change is purely UI state management for enabling a button
No input validation, parsing, or trust-boundary changes
Evidence from the diff
The commit changes LnurlWithdrawRequestDialog.qml. Previously, walletCanReceive was set once at dialog creation, which meant if channels were not yet connected the value stayed zero and the withdraw button could remain disabled. The patch adds a Connections handler that updates walletCanReceive whenever wallet.lightningCanReceive changes, except while requestDetails.busy, avoiding a QML binding loop. This is a UI state synchronization fix, not a cryptographic, network, or permission change.
Changed components
electrum/gui/qml/components/LnurlWithdrawRequestDialog.qmlInspect captured patch +13 / −3
diff --git a/electrum/gui/qml/components/LnurlWithdrawRequestDialog.qml b/electrum/gui/qml/components/LnurlWithdrawRequestDialog.qml
index d923866..4bbcab9 100644
--- a/electrum/gui/qml/components/LnurlWithdrawRequestDialog.qml
+++ b/electrum/gui/qml/components/LnurlWithdrawRequestDialog.qml
@@ -32,9 +32,19 @@ ElDialog {
property bool valid: amountValid
Component.onCompleted: {
- // Initialize walletCanReceive (instead of binding wallet.lightningCanReceive.satsInt)
- // to prevent binding loop if wallet.lightningCanReceive.satsInt changes
- walletCanReceive = wallet.lightningCanReceive.satsInt
+ dialog.walletCanReceive = wallet.lightningCanReceive.satsInt
+ }
+
+ Connections {
+ // assign walletCanReceive directly to prevent a binding loop
+ target: wallet
+ function onLightningCanReceiveChanged() {
+ if (!requestDetails.busy) {
+ // don't assign while busy to prevent the view from changing while receiving
+ // the incoming payment
+ dialog.walletCanReceive = wallet.lightningCanReceive.satsInt
+ }
+ }
}
ColumnLayout {
Why this scored 17/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.