mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-25 17:46:44 +00:00
add output descriptor accessors and copy function
This commit is contained in:
parent
817458a0c3
commit
d5393bd436
1 changed files with 13 additions and 0 deletions
|
@ -73,6 +73,10 @@ public class OutputDescriptor {
|
||||||
return Collections.unmodifiableSet(extendedPublicKeys.keySet());
|
return Collections.unmodifiableSet(extendedPublicKeys.keySet());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<ExtendedKey, KeyDerivation> getExtendedPublicKeysMap() {
|
||||||
|
return Collections.unmodifiableMap(extendedPublicKeys);
|
||||||
|
}
|
||||||
|
|
||||||
public KeyDerivation getKeyDerivation(ExtendedKey extendedPublicKey) {
|
public KeyDerivation getKeyDerivation(ExtendedKey extendedPublicKey) {
|
||||||
return extendedPublicKeys.get(extendedPublicKey);
|
return extendedPublicKeys.get(extendedPublicKey);
|
||||||
}
|
}
|
||||||
|
@ -81,6 +85,10 @@ public class OutputDescriptor {
|
||||||
return multisigThreshold;
|
return multisigThreshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<ExtendedKey, String> getChildDerivationsMap() {
|
||||||
|
return Collections.unmodifiableMap(mapChildrenDerivations);
|
||||||
|
}
|
||||||
|
|
||||||
public String getChildDerivationPath(ExtendedKey extendedPublicKey) {
|
public String getChildDerivationPath(ExtendedKey extendedPublicKey) {
|
||||||
return mapChildrenDerivations.get(extendedPublicKey);
|
return mapChildrenDerivations.get(extendedPublicKey);
|
||||||
}
|
}
|
||||||
|
@ -671,4 +679,9 @@ public class OutputDescriptor {
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return toString().hashCode();
|
return toString().hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public OutputDescriptor copy(boolean includeChildDerivations) {
|
||||||
|
return new OutputDescriptor(scriptType, multisigThreshold, extendedPublicKeys,
|
||||||
|
includeChildDerivations ? mapChildrenDerivations : Collections.emptyMap(), mapExtendedPublicKeyLabels, extendedMasterPrivateKeys);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue