Skip to content

Commit

Permalink
lnd: fix another bug in key derivation
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guggero committed Mar 22, 2022
1 parent 9420752 commit ece4694
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lnd/hdkeychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand Down

0 comments on commit ece4694

Please sign in to comment.