From aa798d6c9449876830d7c624aacdd9ebdd5948fd Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Sat, 7 Oct 2017 00:06:01 +0200 Subject: [PATCH] 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. --- accounts/keystore/account_cache.go | 1 + 1 file changed, 1 insertion(+) diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index 2f80fb563b..4b08cc2029 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -194,6 +194,7 @@ func (ac *accountCache) find(a accounts.Account) (accounts.Account, error) { default: err := &AmbiguousAddrError{Addr: a.Address, Matches: make([]accounts.Account, len(matches))} copy(err.Matches, matches) + sort.Sort(accountsByURL(err.Matches)) return accounts.Account{}, err } }