accounts: switch Ledger derivation path to canonical one

This commit is contained in:
Péter Szilágyi
2019-04-10 13:09:08 +03:00
parent 8cf764da89
commit ae7344d799
8 changed files with 161 additions and 128 deletions

View File

@ -306,12 +306,10 @@ func (api *SignerAPI) startUSBListener() {
status, _ := event.Wallet.Status()
log.Info("New wallet appeared", "url", event.Wallet.URL(), "status", status)
derivationPath := accounts.DefaultBaseDerivationPath
if event.Wallet.URL().Scheme == "ledger" {
derivationPath = accounts.DefaultLedgerBaseDerivationPath
}
var nextPath = derivationPath
// Derive first N accounts, hardcoded for now
var nextPath = make(accounts.DerivationPath, len(accounts.DefaultBaseDerivationPath))
copy(nextPath[:], accounts.DefaultBaseDerivationPath[:])
for i := 0; i < numberOfAccountsToDerive; i++ {
acc, err := event.Wallet.Derive(nextPath, true)
if err != nil {