diff --git a/drongo b/drongo
index c12dac9a..c8165e15 160000
--- a/drongo
+++ b/drongo
@@ -1 +1 @@
-Subproject commit c12dac9a25ef410f8f1bb77dd6b1ea12c4e0b002
+Subproject commit c8165e154a4088262cdf9428f8f8a6ef95db5140
diff --git a/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java b/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java
index 70db8fe3..e7e03e17 100644
--- a/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java
+++ b/src/main/java/com/sparrowwallet/sparrow/SparrowDesktop.java
@@ -80,6 +80,7 @@ public class SparrowDesktop extends Application {
}
System.setProperty(Wallet.ALLOW_DERIVATIONS_MATCHING_OTHER_SCRIPT_TYPES_PROPERTY, Boolean.toString(!Config.get().isValidateDerivationPaths()));
+ System.setProperty(Wallet.ALLOW_DERIVATIONS_MATCHING_OTHER_NETWORKS_PROPERTY, Boolean.toString(!Config.get().isValidateDerivationPaths()));
if(Config.get().getAppHeight() != null && Config.get().getAppWidth() != null) {
mainStage.setWidth(Config.get().getAppWidth());
diff --git a/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java b/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java
index df6fee28..39620c74 100644
--- a/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java
+++ b/src/main/java/com/sparrowwallet/sparrow/preferences/GeneralPreferencesController.java
@@ -175,6 +175,7 @@ public class GeneralPreferencesController extends PreferencesDetailController {
validateDerivationPaths.selectedProperty().addListener((observableValue, oldValue, newValue) -> {
config.setValidateDerivationPaths(newValue);
System.setProperty(Wallet.ALLOW_DERIVATIONS_MATCHING_OTHER_SCRIPT_TYPES_PROPERTY, Boolean.toString(!newValue));
+ System.setProperty(Wallet.ALLOW_DERIVATIONS_MATCHING_OTHER_NETWORKS_PROPERTY, Boolean.toString(!newValue));
});
groupByAddress.setSelected(config.isGroupByAddress());
diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java
index 1f12ae02..8dc50a8b 100644
--- a/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java
+++ b/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java
@@ -186,7 +186,7 @@ public class KeystoreController extends WalletFormController implements Initiali
return null;
}));
derivation.textProperty().addListener((observable, oldValue, newValue) -> {
- if(KeyDerivation.isValid(newValue) && !walletForm.getWallet().derivationMatchesAnotherScriptType(newValue)) {
+ if(KeyDerivation.isValid(newValue) && !walletForm.getWallet().derivationMatchesAnotherScriptType(newValue) && !walletForm.getWallet().derivationMatchesAnotherNetwork(newValue)) {
keystore.setKeyDerivation(new KeyDerivation(keystore.getKeyDerivation().getMasterFingerprint(), newValue));
EventManager.get().post(new SettingsChangedEvent(walletForm.getWallet(), SettingsChangedEvent.Type.KEYSTORE_DERIVATION));
}
@@ -287,7 +287,8 @@ public class KeystoreController extends WalletFormController implements Initiali
validationSupport.registerValidator(derivation, Validator.combine(
Validator.createEmptyValidator("Derivation is required"),
(Control c, String newValue) -> ValidationResult.fromErrorIf( c, "Derivation is invalid", !KeyDerivation.isValid(newValue)),
- (Control c, String newValue) -> ValidationResult.fromErrorIf( c, "Derivation matches another script type", walletForm.getWallet().derivationMatchesAnotherScriptType(newValue))
+ (Control c, String newValue) -> ValidationResult.fromErrorIf( c, "Derivation matches another script type", walletForm.getWallet().derivationMatchesAnotherScriptType(newValue)),
+ (Control c, String newValue) -> ValidationResult.fromErrorIf( c, "Derivation matches another network", walletForm.getWallet().derivationMatchesAnotherNetwork(newValue))
));
validationSupport.registerValidator(fingerprint, Validator.combine(
diff --git a/src/main/resources/com/sparrowwallet/sparrow/preferences/general.fxml b/src/main/resources/com/sparrowwallet/sparrow/preferences/general.fxml
index 65788e20..79249888 100644
--- a/src/main/resources/com/sparrowwallet/sparrow/preferences/general.fxml
+++ b/src/main/resources/com/sparrowwallet/sparrow/preferences/general.fxml
@@ -76,7 +76,7 @@