diff --git a/drongo b/drongo index 8dd8b9ef..6bd3d803 160000 --- a/drongo +++ b/drongo @@ -1 +1 @@ -Subproject commit 8dd8b9efc03b346bf6eb6c99d02409239d568ce6 +Subproject commit 6bd3d803037f5cf00ece1d4615b071c4fc98fe9f diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 659685c4..eccfb4a9 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -1911,7 +1911,7 @@ public class AppController implements Initializable { } private void addTransactionTab(String name, File file, PSBT psbt) { - //Convert to PSBTv0 first + //Convert to PSBTv0 first as the consistent internal representation if(psbt.getVersion() != null && psbt.getVersion() >= 2) { psbt.convertVersion(0); } diff --git a/src/main/java/com/sparrowwallet/sparrow/control/QRScanDialog.java b/src/main/java/com/sparrowwallet/sparrow/control/QRScanDialog.java index ec6a92ce..4f4e2904 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/QRScanDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/QRScanDialog.java @@ -656,7 +656,7 @@ public class QRScanDialog extends Dialog { List path = cryptoKeypath.getComponents().stream().map(comp -> (IndexPathComponent)comp) .map(comp -> new ChildNumber(comp.getIndex(), comp.isHardened())).collect(Collectors.toList()); - String fingerprint = cryptoKeypath.getSourceFingerprint() == null ? KeystoreController.DEFAULT_WATCH_ONLY_FINGERPRINT : Utils.bytesToHex(cryptoKeypath.getSourceFingerprint()); + String fingerprint = cryptoKeypath.getSourceFingerprint() == null ? KeyDerivation.DEFAULT_WATCH_ONLY_FINGERPRINT : Utils.bytesToHex(cryptoKeypath.getSourceFingerprint()); return new KeyDerivation(fingerprint, KeyDerivation.writePath(path)); } diff --git a/src/main/java/com/sparrowwallet/sparrow/io/Descriptor.java b/src/main/java/com/sparrowwallet/sparrow/io/Descriptor.java index e836ab22..d3caae6d 100644 --- a/src/main/java/com/sparrowwallet/sparrow/io/Descriptor.java +++ b/src/main/java/com/sparrowwallet/sparrow/io/Descriptor.java @@ -140,7 +140,7 @@ public class Descriptor implements WalletImport, WalletExport { private static Wallet ensureKeyDerivations(Wallet wallet) { for(Keystore keystore : wallet.getKeystores()) { if(keystore.getKeyDerivation().getMasterFingerprint() == null || keystore.getKeyDerivation().getDerivationPath() == null) { - keystore.setKeyDerivation(new KeyDerivation(KeystoreController.DEFAULT_WATCH_ONLY_FINGERPRINT, wallet.getScriptType().getDefaultDerivationPath())); + keystore.setKeyDerivation(new KeyDerivation(KeyDerivation.DEFAULT_WATCH_ONLY_FINGERPRINT, wallet.getScriptType().getDefaultDerivationPath())); } } diff --git a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/KeystoreImportDialog.java b/src/main/java/com/sparrowwallet/sparrow/keystoreimport/KeystoreImportDialog.java index c02c415b..14c322f7 100644 --- a/src/main/java/com/sparrowwallet/sparrow/keystoreimport/KeystoreImportDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/keystoreimport/KeystoreImportDialog.java @@ -82,7 +82,7 @@ public class KeystoreImportDialog extends Dialog { keystore.setLabel(existingLabel); keystore.setSource(KeystoreSource.SW_WATCH); keystore.setWalletModel(WalletModel.SPARROW); - keystore.setKeyDerivation(new KeyDerivation(KeystoreController.DEFAULT_WATCH_ONLY_FINGERPRINT, scriptType.getDefaultDerivationPath())); + keystore.setKeyDerivation(new KeyDerivation(KeyDerivation.DEFAULT_WATCH_ONLY_FINGERPRINT, scriptType.getDefaultDerivationPath())); return keystore; } diff --git a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/WatchOnlyDialog.java b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/WatchOnlyDialog.java index 655858e3..b6980277 100644 --- a/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/WatchOnlyDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/terminal/wallet/WatchOnlyDialog.java @@ -20,8 +20,6 @@ import org.slf4j.LoggerFactory; import java.util.*; -import static com.sparrowwallet.sparrow.wallet.KeystoreController.DEFAULT_WATCH_ONLY_FINGERPRINT; - public class WatchOnlyDialog extends NewWalletDialog { private static final Logger log = LoggerFactory.getLogger(WatchOnlyDialog.class); @@ -126,7 +124,7 @@ public class WatchOnlyDialog extends NewWalletDialog { Keystore keystore = new Keystore(); keystore.setSource(KeystoreSource.SW_WATCH); keystore.setWalletModel(WalletModel.SPARROW); - keystore.setKeyDerivation(new KeyDerivation(DEFAULT_WATCH_ONLY_FINGERPRINT, scriptType.getDefaultDerivationPath())); + keystore.setKeyDerivation(new KeyDerivation(KeyDerivation.DEFAULT_WATCH_ONLY_FINGERPRINT, scriptType.getDefaultDerivationPath())); keystore.setExtendedPublicKey(xpub); wallet.makeLabelsUnique(keystore); wallet.getKeystores().add(keystore); diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java index fb56d111..4d712c42 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/KeystoreController.java @@ -44,8 +44,6 @@ import static com.sparrowwallet.sparrow.io.CardApi.isReaderAvailable; public class KeystoreController extends WalletFormController implements Initializable { private static final Logger log = LoggerFactory.getLogger(KeystoreController.class); - public static final String DEFAULT_WATCH_ONLY_FINGERPRINT = "00000000"; - private Keystore keystore; @FXML @@ -252,7 +250,7 @@ public class KeystoreController extends WalletFormController implements Initiali if(keystoreSource != KeystoreSource.SW_WATCH) { launchImportDialog(keystoreSource); } else { - fingerprint.setText(DEFAULT_WATCH_ONLY_FINGERPRINT); + fingerprint.setText(KeyDerivation.DEFAULT_WATCH_ONLY_FINGERPRINT); derivation.setText(getWalletForm().getWallet().getScriptType().getDefaultDerivationPath()); selectSourcePane.setVisible(false); }