clear a selected paynym from the send tab pay to field before applying a scanned address or uri
What changed, and why it matters
This commit fixes a UI bug in Sparrow Wallet's send tab. Previously, if a user had selected a PayNym (a human-readable payment contact) in the 'pay to' field and then scanned a QR code containing a regular Bitcoin address or payment URI, the old PayNym text could remain in the field while the new address/URI was applied. The patch now clears the PayNym text before applying the scanned address or URI, preventing confusion about who or what address the payment is actually going to. This could reduce the risk of a user accidentally sending funds to the wrong recipient, but it is a UI consistency fix rather than a cryptographic vulnerability.
Treat as a low-severity UX/security hardening fix. Include in the next release. No urgent advisory is warranted unless there is evidence of active exploitation or a reproducible path to fund loss beyond user confusion.
Security signals we found
UI state desynchronization between displayed recipient and applied recipient
Potential user confusion leading to incorrect payment destination
Defensive fix in payment workflow
Evidence from the diff
In PaymentController.java, the scanQrAddress method now checks whether payNymProperty is non-null and the QR scan result contains either a URI or a raw payload (address). If so, it clears address.setText(“”) before invoking updateFromURI or updateFromPayload. This ensures stale PayNym display text is removed when a scanned address/URI replaces the current recipient. The change is defensive UI state cleanup and does not alter transaction signing, address validation, or wallet logic.
Changed components
src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.javaSend tab recipient/PayNym fieldQR address/URI scanning flowInspect captured patch +4 / −0
### src/main/java/com/sparrowwallet/sparrow/wallet/PaymentController.java
@@ -811,6 +811,10 @@ public void scanQrAddress(ActionEvent event) {
Optional<QRScanDialog.Result> optionalResult = qrScanDialog.showAndWait();
if(optionalResult.isPresent()) {
QRScanDialog.Result result = optionalResult.get();
+ if(payNymProperty.get() != null && (result.uri != null || result.payload != null)) {
+ address.setText("");
+ }
+
if(result.uri != null) {
updateFromURI(result.uri);
} else if(result.payload != null) {Why this scored 38/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.