What changed, and why it matters
This commit hides the 'gap limit' setting from the user interface for single-signature single-key (SP) wallets. The gap limit controls how many unused addresses Sparrow scans ahead for transactions. For this specific wallet type, the setting is now hidden because it is not applicable or could confuse users. There is no direct security vulnerability in the code change itself; it is a UI cleanup change.
No security action required. Treat as a normal UI/usability fix.
Security signals we found
No security-relevant code paths modified
UI-only change hiding a configuration field for a specific wallet policy type
No input validation, cryptography, network, or storage logic changed
Evidence from the diff
The patch adds an fx:id to the gap limit Field in advanced.fxml and binds its managed/visible properties in AdvancedController so the field is hidden when wallet.getPolicyType() == PolicyType.SINGLE_SP. It also adjusts the watchLast control’s preferred width. The change is purely presentational and does not alter wallet scanning logic, address derivation, or any cryptographic operation.
Changed components
Sparrow Wallet advanced wallet settings UIAdvancedController.javaadvanced.fxmlInspect captured patch +10 / −1
diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/AdvancedController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/AdvancedController.java
index a57d9e3..31e115e 100644
--- a/src/main/java/com/sparrowwallet/sparrow/wallet/AdvancedController.java
+++ b/src/main/java/com/sparrowwallet/sparrow/wallet/AdvancedController.java
@@ -1,5 +1,6 @@
package com.sparrowwallet.sparrow.wallet;
+import com.sparrowwallet.drongo.policy.PolicyType;
import com.sparrowwallet.drongo.wallet.Wallet;
import com.sparrowwallet.sparrow.EventManager;
import com.sparrowwallet.sparrow.control.DateStringConverter;
@@ -12,6 +13,7 @@ import javafx.fxml.Initializable;
import javafx.scene.control.ComboBox;
import javafx.scene.control.DatePicker;
import javafx.scene.control.Label;
+import tornadofx.control.Field;
import javafx.util.StringConverter;
import java.net.URL;
@@ -30,6 +32,9 @@ public class AdvancedController implements Initializable {
@FXML
private DatePicker birthDate;
+ @FXML
+ private Field gapLimitField;
+
@FXML
private IntegerSpinner gapLimit;
@@ -56,6 +61,9 @@ public class AdvancedController implements Initializable {
}
});
+ gapLimitField.managedProperty().bind(gapLimitField.visibleProperty());
+ gapLimitField.setVisible(wallet.getPolicyType() != PolicyType.SINGLE_SP);
+
gapLimit.setValueFactory(new IntegerSpinner.ValueFactory(Wallet.DEFAULT_LOOKAHEAD, MAX_GAP_LIMIT, wallet.getGapLimit()));
gapLimit.valueProperty().addListener((observable, oldValue, newValue) -> {
if(newValue == null || newValue < Wallet.DEFAULT_LOOKAHEAD || newValue > MAX_GAP_LIMIT) {
@@ -84,6 +92,7 @@ public class AdvancedController implements Initializable {
gapWarning.managedProperty().bind(gapWarning.visibleProperty());
gapWarning.setVisible(wallet.getGapLimit() >= WARNING_GAP_LIMIT);
+ watchLast.setPrefWidth(birthDate.getPrefWidth());
watchLast.setItems(getWatchListItems(wallet));
watchLast.setConverter(new StringConverter<>() {
@Override
diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/advanced.fxml b/src/main/resources/com/sparrowwallet/sparrow/wallet/advanced.fxml
index bb95c79..a9b61fc 100644
--- a/src/main/resources/com/sparrowwallet/sparrow/wallet/advanced.fxml
+++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/advanced.fxml
@@ -32,7 +32,7 @@
<DatePicker editable="false" fx:id="birthDate" prefWidth="140" />
<HelpLabel helpText="The date of the earliest transaction (used to avoid scanning the entire blockchain)."/>
</Field>
- <Field text="Gap limit:">
+ <Field fx:id="gapLimitField" text="Gap limit:">
<IntegerSpinner fx:id="gapLimit" editable="true" prefWidth="90" />
<HelpLabel helpText="Change how far ahead to look for additional transactions beyond the highest derivation with previous transaction outputs."/>
<Label fx:id="gapWarning">
Why this scored 21/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.