Fix key store address hex decoding and accounts test

Thanks to https://github.com/jaekwon for original fix!
This commit is contained in:
Gustav Simonsson
2015-02-24 18:03:10 +01:00
parent 91a8c08f03
commit 923950ccaa
3 changed files with 22 additions and 3 deletions

View File

@ -119,8 +119,11 @@ func GetKeyAddresses(keysDirPath string) (addresses [][]byte, err error) {
}
addresses = make([][]byte, len(fileInfos))
for i, fileInfo := range fileInfos {
addresses[i] = make([]byte, 40)
addresses[i] = []byte(fileInfo.Name())
address, err := hex.DecodeString(fileInfo.Name())
if err != nil {
continue
}
addresses[i] = address
}
return addresses, err
}