From 666286f0a7eed1756949db2be1273e4814bea609 Mon Sep 17 00:00:00 2001 From: David Hill Date: Wed, 24 Jul 2019 20:15:25 +0000 Subject: [PATCH] hdkeychain: Add ChildNum and Depth methods. --- hdkeychain/extendedkey.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hdkeychain/extendedkey.go b/hdkeychain/extendedkey.go index 285e7b26..c9a85376 100644 --- a/hdkeychain/extendedkey.go +++ b/hdkeychain/extendedkey.go @@ -172,6 +172,16 @@ func (k *ExtendedKey) pubKeyBytes() []byte { return k.pubKey } +// ChildNum returns the child number of the extended key. +func (k *ExtendedKey) ChildNum() uint32 { + return k.childNum +} + +// Depth returns the depth of the extended key. +func (k *ExtendedKey) Depth() uint16 { + return k.depth +} + // IsPrivate returns whether or not the extended key is a private extended key. // // A private extended key can be used to derive both hardened and non-hardened