mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 12:46:44 +00:00
Update wallet.go
This commit is contained in:
parent
ad3a93f8e2
commit
a8d26b2e92
1 changed files with 8 additions and 7 deletions
|
|
@ -340,12 +340,13 @@ func (w *wallet) selfDerive() {
|
||||||
var (
|
var (
|
||||||
accs []accounts.Account
|
accs []accounts.Account
|
||||||
paths []accounts.DerivationPath
|
paths []accounts.DerivationPath
|
||||||
|
|
||||||
nextPaths = append([]accounts.DerivationPath{}, w.deriveNextPaths...)
|
|
||||||
nextAddrs = append([]common.Address{}, w.deriveNextAddrs...)
|
|
||||||
|
|
||||||
context = context.Background()
|
context = context.Background()
|
||||||
|
nextAddrs = append([]common.Address{}, w.deriveNextAddrs...)
|
||||||
)
|
)
|
||||||
|
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 i := 0; i < len(nextAddrs); i++ {
|
||||||
for empty := false; !empty; {
|
for empty := false; !empty; {
|
||||||
// Retrieve the next derived Ethereum account
|
// Retrieve the next derived Ethereum account
|
||||||
|
|
@ -632,7 +633,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
|
// data is not supported for Ledger wallets, so this method will always return
|
||||||
// an error.
|
// an error.
|
||||||
func (w *wallet) SignTextWithPassphrase(account accounts.Account, passphrase string, text []byte) ([]byte, 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
|
// SignTxWithPassphrase implements accounts.Wallet, attempting to sign the given
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue