From f4d3df62aa5fb754790ca70ab5a87add44c42872 Mon Sep 17 00:00:00 2001 From: Alvarez <140459501+prestoalvarez@users.noreply.github.com> Date: Wed, 26 Nov 2025 23:23:20 +0100 Subject: [PATCH] Update wallet.go --- accounts/usbwallet/wallet.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index 5997a2a676..04e8b60517 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -343,6 +343,8 @@ func (w *wallet) selfDerive() { context = context.Background() nextAddrs = append([]common.Address{}, w.deriveNextAddrs...) ) + // 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...)