accounts: switch Ledger derivation path to canonical one

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

No files matched your search

+3 -5
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 {