3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-15 11:45:51 +00:00

HDKeyDerivation: Make precondition message more clear in deriveChildKeyBytesFromPublic().

This commit is contained in:
Andreas Schildbach 2019-05-03 22:50:37 +02:00
parent 4283d58c23
commit 7197534485

View File

@ -186,7 +186,7 @@ public final class HDKeyDerivation {
}
public static RawKeyBytes deriveChildKeyBytesFromPublic(DeterministicKey parent, ChildNumber childNumber, PublicDeriveMode mode) throws HDDerivationException {
checkArgument(!childNumber.isHardened(), "Can't use private derivation with public keys only.");
checkArgument(!childNumber.isHardened(), "Hardened derivation is unsupported (%s).", childNumber);
byte[] parentPublicKey = parent.getPubKeyPoint().getEncoded(true);
checkState(parentPublicKey.length == 33, "Parent pubkey must be 33 bytes, but is " + parentPublicKey.length);
ByteBuffer data = ByteBuffer.allocate(37);