set lower bound on bip47 account index

This commit is contained in:
Craig Raw 2022-05-19 12:29:56 +02:00
parent 38deacaeec
commit d24243ce20

View file

@ -96,7 +96,7 @@ public class KeyDerivation {
} }
public static List<ChildNumber> getBip47Derivation(int account) { public static List<ChildNumber> getBip47Derivation(int account) {
return List.of(new ChildNumber(47, true), new ChildNumber(Network.get() == Network.MAINNET ? 0 : 1, true), new ChildNumber(account, true)); return List.of(new ChildNumber(47, true), new ChildNumber(Network.get() == Network.MAINNET ? 0 : 1, true), new ChildNumber(Math.max(0, account), true));
} }
public KeyDerivation copy() { public KeyDerivation copy() {