add master wallet reference

This commit is contained in:
Craig Raw 2021-05-14 12:54:31 +02:00
parent cc32285d58
commit 7dca0d0c39

View file

@ -24,6 +24,7 @@ public class Wallet {
public static final String ALLOW_DERIVATIONS_MATCHING_OTHER_SCRIPT_TYPES_PROPERTY = "com.sparrowwallet.allowDerivationsMatchingOtherScriptTypes"; public static final String ALLOW_DERIVATIONS_MATCHING_OTHER_SCRIPT_TYPES_PROPERTY = "com.sparrowwallet.allowDerivationsMatchingOtherScriptTypes";
private String name; private String name;
private Wallet masterWallet;
private Network network = Network.get(); private Network network = Network.get();
private PolicyType policyType; private PolicyType policyType;
private ScriptType scriptType; private ScriptType scriptType;
@ -140,6 +141,14 @@ public class Wallet {
this.birthDate = birthDate; this.birthDate = birthDate;
} }
public Wallet getMasterWallet() {
return masterWallet;
}
public void setMasterWallet(Wallet masterWallet) {
this.masterWallet = masterWallet;
}
public synchronized WalletNode getNode(KeyPurpose keyPurpose) { public synchronized WalletNode getNode(KeyPurpose keyPurpose) {
WalletNode purposeNode; WalletNode purposeNode;
Optional<WalletNode> optionalPurposeNode = purposeNodes.stream().filter(node -> node.getKeyPurpose().equals(keyPurpose)).findFirst(); Optional<WalletNode> optionalPurposeNode = purposeNodes.stream().filter(node -> node.getKeyPurpose().equals(keyPurpose)).findFirst();