accounts, cmd, internal, node: implement HD wallet self-derivation

This commit is contained in:
Péter Szilágyi
2017-02-08 20:25:52 +02:00
parent c5215fdd48
commit 205ea95802
9 changed files with 383 additions and 136 deletions

View File

@ -253,10 +253,14 @@ func (s *PrivateAccountAPI) DeriveAccount(url string, path string, pin *bool) (a
if err != nil {
return accounts.Account{}, err
}
derivPath, err := accounts.ParseDerivationPath(path)
if err != nil {
return accounts.Account{}, err
}
if pin == nil {
pin = new(bool)
}
return wallet.Derive(path, *pin)
return wallet.Derive(derivPath, *pin)
}
// NewAccount will create a new account and returns the address for the new account.