From 0aedc0787fa4d4f43a3c6ece009f6e254506318b Mon Sep 17 00:00:00 2001 From: Alvarez <140459501+prestoalvarez@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:28:06 +0100 Subject: [PATCH] Update wallet.go --- accounts/usbwallet/wallet.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index 3fc121c773..0fd0415a9e 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -338,17 +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() ) - // Deep-copy derivation paths so updates inside this section don't mutate - // w.deriveNextPaths while we only hold stateLock.RLock. - 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 @@ -635,7 +632,7 @@ func (w *wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID // data is not supported for Ledger wallets, so this method will always return // an error. func (w *wallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error) { - return w.SignText(account, text) + return w.SignText(account, accounts.TextHash(text)) } // SignTxWithPassphrase implements accounts.Wallet, attempting to sign the given