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

@ -328,11 +328,13 @@ func startNode(ctx *cli.Context, stack *node.Node) {
status, _ := event.Wallet.Status()
log.Info("New wallet appeared", "url", event.Wallet.URL(), "status", status)
derivationPath := accounts.DefaultBaseDerivationPath
var derivationPaths []accounts.DerivationPath
if event.Wallet.URL().Scheme == "ledger" {
derivationPath = accounts.DefaultLedgerBaseDerivationPath
derivationPaths = append(derivationPaths, accounts.LegacyLedgerBaseDerivationPath)
}
event.Wallet.SelfDerive(derivationPath, stateReader)
derivationPaths = append(derivationPaths, accounts.DefaultBaseDerivationPath)
event.Wallet.SelfDerive(derivationPaths, stateReader)
case accounts.WalletDropped:
log.Info("Old wallet dropped", "url", event.Wallet.URL())