mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
accounts/keystore: sort accounts in AmbiguousAddrError
This fixes a failing cmd/geth test. AmbiguousAddrErrors are created in find, which uses ac.all or byAddr[addr]. ac.all is always sorted, but byAddr[addr] might not be.
This commit is contained in:
parent
b65482fac2
commit
aa798d6c94
1 changed files with 1 additions and 0 deletions
|
|
@ -194,6 +194,7 @@ func (ac *accountCache) find(a accounts.Account) (accounts.Account, error) {
|
||||||
default:
|
default:
|
||||||
err := &AmbiguousAddrError{Addr: a.Address, Matches: make([]accounts.Account, len(matches))}
|
err := &AmbiguousAddrError{Addr: a.Address, Matches: make([]accounts.Account, len(matches))}
|
||||||
copy(err.Matches, matches)
|
copy(err.Matches, matches)
|
||||||
|
sort.Sort(accountsByURL(err.Matches))
|
||||||
return accounts.Account{}, err
|
return accounts.Account{}, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue