From ece46945b13109f6fa9e495f8048e925cda02843 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 22 Mar 2022 21:42:12 +0100 Subject: [PATCH] lnd: fix another bug in key derivation Turns out, the same "we create a default account immediately but any other account is loaded from the DB" rule applies to the coin type key too. --- lnd/hdkeychain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnd/hdkeychain.go b/lnd/hdkeychain.go index 0ba7c75..6957343 100644 --- a/lnd/hdkeychain.go +++ b/lnd/hdkeychain.go @@ -45,7 +45,7 @@ func DeriveChildren(key *hdkeychain.ExtendedKey, path []uint32) ( // derived directly. depth := derivedKey.Depth() keyID := pathPart - hdkeychain.HardenedKeyStart - if (depth == 3 && keyID != 0) || depth == 2 { + if (depth == 3 && keyID != 0) || (depth == 2 && keyID != 0) { currentKey, err = hdkeychain.NewKeyFromString( derivedKey.String(), )