accounts: ledger and HD review fixes

- Handle a data race where a Ledger drops between list and open
- Prolong Ledger tx confirmation window to 30 days from 1 minute
- Simplify Ledger chainid-signature calculation and validation
- Simplify Ledger USB APDU request chunking algorithm
- Silence keystore account cache notifications for manual actions
- Only enable self derivations if wallet open succeeds
This commit is contained in:
Péter Szilágyi
2017-02-11 17:02:00 +02:00
parent c7022c1a0c
commit e99c788155
5 changed files with 39 additions and 60 deletions

View File

@ -113,11 +113,6 @@ func (ac *accountCache) add(newAccount accounts.Account) {
copy(ac.all[i+1:], ac.all[i:])
ac.all[i] = newAccount
ac.byAddr[newAccount.Address] = append(ac.byAddr[newAccount.Address], newAccount)
select {
case ac.notify <- struct{}{}:
default:
}
}
// note: removed needs to be unique here (i.e. both File and Address must be set).
@ -131,10 +126,6 @@ func (ac *accountCache) delete(removed accounts.Account) {
} else {
ac.byAddr[removed.Address] = ba
}
select {
case ac.notify <- struct{}{}:
default:
}
}
func removeAccount(slice []accounts.Account, elem accounts.Account) []accounts.Account {