Merge pull request #19438 from karalabe/ledger-new-derivation-path

accounts: switch Ledger derivation path to canonical one
This commit is contained in:
Péter Szilágyi
2019-04-25 13:33:17 +03:00
committed by GitHub
8 changed files with 165 additions and 135 deletions

View File

@ -342,11 +342,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())