diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index 5997a2a676..0fd0415a9e 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -338,15 +338,14 @@ func (w *wallet) selfDerive() { } // Device lock obtained, derive the next batch of accounts var ( - accs []accounts.Account - paths []accounts.DerivationPath - context = context.Background() + accs []accounts.Account + paths []accounts.DerivationPath + + nextPaths = append([]accounts.DerivationPath{}, w.deriveNextPaths...) nextAddrs = append([]common.Address{}, w.deriveNextAddrs...) + + context = context.Background() ) - nextPaths := make([]accounts.DerivationPath, len(w.deriveNextPaths)) - for i, path := range w.deriveNextPaths { - nextPaths[i] = append(accounts.DerivationPath(nil), path...) - } for i := 0; i < len(nextAddrs); i++ { for empty := false; !empty; { // Retrieve the next derived Ethereum account