The drop helper uses sort.Search on the sorted wallet list, but the
returned index can point at the next greater wallet when the target URL
is missing. Fix this by rewriting the drop to use slices.DeleteFunc and a map.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
Fixes a data race on the `wallets` slice when closing account Manager.
At the moment, there is a data race between a go-routine calling the
Manager's `Close` function and the background go-routine handling most
operations on the `Manager`. The `Manager`'s `wallets` field is accessed
without proper synchronization.
By moving the closing of wallets from the `Close()` function into the
background thread, this issue can be resolved.
This is one further step towards removing account management from
`geth`. This PR deprecates the flag `unlock`, and makes the flag moot:
unlock via geth is no longer possible.
* accounts/mananger, internal/ethapi/api: Add new function AllAccounts on account manager to remove the duplication code on getting all wallets accounts
* Rename to Accounts
* Rename to AllAccounts