From 87b5f992d085efac64e7466af4906f9d1691fc8a Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 22 Aug 2024 11:03:01 +0200 Subject: [PATCH] add constructor to optionally rewrite derivation path --- src/main/java/com/sparrowwallet/drongo/KeyDerivation.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/drongo/KeyDerivation.java b/src/main/java/com/sparrowwallet/drongo/KeyDerivation.java index 123f046..e5d8649 100644 --- a/src/main/java/com/sparrowwallet/drongo/KeyDerivation.java +++ b/src/main/java/com/sparrowwallet/drongo/KeyDerivation.java @@ -17,9 +17,13 @@ public class KeyDerivation { } public KeyDerivation(String masterFingerprint, String derivationPath) { + this(masterFingerprint, derivationPath, false); + } + + public KeyDerivation(String masterFingerprint, String derivationPath, boolean rewritePath) { this.masterFingerprint = masterFingerprint == null ? null : masterFingerprint.toLowerCase(Locale.ROOT); - this.derivationPath = derivationPath; this.derivation = parsePath(derivationPath); + this.derivationPath = rewritePath ? writePath(derivation) : derivationPath; } public String getMasterFingerprint() {