Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request: fix bip44 (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongqiuwood authored Nov 18, 2020
1 parent 41c515d commit e800af9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crypto/keys/hd/hdpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ func (p BIP44Params) DerivationPath() []uint32 {
}
}


// String returns the full HD path of the BIP44 (https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) params:
// m / purpose' / coin_type' / account' / change / address_index
func (p BIP44Params) String() string {
var changeStr string
if p.Change {
Expand All @@ -152,7 +155,7 @@ func (p BIP44Params) String() string {
changeStr = "0"
}
// m / Purpose' / coin_type' / Account' / Change / address_index
return fmt.Sprintf("%d'/%d'/%d'/%s/%d",
return fmt.Sprintf("m/%d'/%d'/%d'/%s/%d",
p.Purpose,
p.CoinType,
p.Account,
Expand Down

0 comments on commit e800af9

Please sign in to comment.