Skip to content

Commit 188f73e

Browse files
Update wallet.go
1 parent 689ea10 commit 188f73e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

accounts/usbwallet/wallet.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,15 @@ func (w *wallet) selfDerive() {
338338
}
339339
// Device lock obtained, derive the next batch of accounts
340340
var (
341-
accs []accounts.Account
342-
paths []accounts.DerivationPath
343-
344-
nextPaths = append([]accounts.DerivationPath{}, w.deriveNextPaths...)
345-
nextAddrs = append([]common.Address{}, w.deriveNextAddrs...)
346-
341+
accs []accounts.Account
342+
paths []accounts.DerivationPath
347343
context = context.Background()
344+
nextAddrs = append([]common.Address{}, w.deriveNextAddrs...)
348345
)
346+
nextPaths := make([]accounts.DerivationPath, len(w.deriveNextPaths))
347+
for i, path := range w.deriveNextPaths {
348+
nextPaths[i] = append(accounts.DerivationPath(nil), path...)
349+
}
349350
for i := 0; i < len(nextAddrs); i++ {
350351
for empty := false; !empty; {
351352
// Retrieve the next derived Ethereum account
@@ -632,7 +633,7 @@ func (w *wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID
632633
// data is not supported for Ledger wallets, so this method will always return
633634
// an error.
634635
func (w *wallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, error) {
635-
return w.SignText(account, text)
636+
return w.SignText(account, accounts.TextHash(text))
636637
}
637638

638639
// SignTxWithPassphrase implements accounts.Wallet, attempting to sign the given

0 commit comments

Comments
 (0)