瀏覽代碼

signer/core: fix reference issue in key derivation (#19827)

* signer/core: fix reference issue in key derivation

* Review feedback
Guillaume Ballet 6 年之前
父節點
當前提交
9466b9eec5
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      accounts/usbwallet/wallet.go

+ 2 - 1
accounts/usbwallet/wallet.go

@@ -479,7 +479,8 @@ func (w *wallet) Derive(path accounts.DerivationPath, pin bool) (accounts.Accoun
 
 	if _, ok := w.paths[address]; !ok {
 		w.accounts = append(w.accounts, account)
-		w.paths[address] = path
+		w.paths[address] = make(accounts.DerivationPath, len(path))
+		copy(w.paths[address], path)
 	}
 	return account, nil
 }