accounts: cache key addresses
In order to avoid disk thrashing for Accounts and HasAccount, address->key file mappings are now cached in memory. This makes it no longer necessary to keep the key address in the file name. The address of each key is derived from file content instead. There are minor user-visible changes: - "geth account list" now reports key file paths alongside the address. - If multiple keys are present for an address, unlocking by address is not possible. Users are directed to remove the duplicate files instead. Unlocking by index is still possible. - Key files are overwritten written in place when updating the password.
Showing
- accounts/account_manager.go 111 additions, 78 deletionsaccounts/account_manager.go
- accounts/accounts_test.go 48 additions, 6 deletionsaccounts/accounts_test.go
- accounts/addrcache.go 269 additions, 0 deletionsaccounts/addrcache.go
- accounts/addrcache_test.go 283 additions, 0 deletionsaccounts/addrcache_test.go
- accounts/key.go 72 additions, 22 deletionsaccounts/key.go
- accounts/key_store_passphrase.go 27 additions, 46 deletionsaccounts/key_store_passphrase.go
- accounts/key_store_passphrase_test.go 12 additions, 3 deletionsaccounts/key_store_passphrase_test.go
- accounts/key_store_plain.go 14 additions, 151 deletionsaccounts/key_store_plain.go
- accounts/key_store_test.go 55 additions, 48 deletionsaccounts/key_store_test.go
- accounts/presale.go 5 additions, 4 deletionsaccounts/presale.go
- accounts/testdata/keystore/README 2 additions, 2 deletionsaccounts/testdata/keystore/README
- accounts/testdata/keystore/aaa 0 additions, 0 deletionsaccounts/testdata/keystore/aaa
- accounts/testdata/keystore/zzz 0 additions, 0 deletionsaccounts/testdata/keystore/zzz
- accounts/testdata/very-light-scrypt.json 1 addition, 0 deletionsaccounts/testdata/very-light-scrypt.json
- accounts/watch.go 113 additions, 0 deletionsaccounts/watch.go
- accounts/watch_fallback.go 28 additions, 0 deletionsaccounts/watch_fallback.go
- cmd/geth/accountcmd.go 4 additions, 4 deletionscmd/geth/accountcmd.go
- cmd/geth/accountcmd_test.go 13 additions, 4 deletionscmd/geth/accountcmd_test.go
Loading
Please register or sign in to comment