Skip to content

Commit ece4694

Browse files
committed
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.
1 parent 9420752 commit ece4694

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lnd/hdkeychain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func DeriveChildren(key *hdkeychain.ExtendedKey, path []uint32) (
4545
// derived directly.
4646
depth := derivedKey.Depth()
4747
keyID := pathPart - hdkeychain.HardenedKeyStart
48-
if (depth == 3 && keyID != 0) || depth == 2 {
48+
if (depth == 3 && keyID != 0) || (depth == 2 && keyID != 0) {
4949
currentKey, err = hdkeychain.NewKeyFromString(
5050
derivedKey.String(),
5151
)

0 commit comments

Comments
 (0)