Fix ignore of unexpected files in key dir

This commit is contained in:
Gustav Simonsson 2015-04-23 05:52:41 +02:00
parent 94f2adb80a
commit 9d2a156453
1 changed files with 3 additions and 3 deletions

View File

@ -117,13 +117,13 @@ func GetKeyAddresses(keysDirPath string) (addresses [][]byte, err error) {
if err != nil {
return nil, err
}
addresses = make([][]byte, len(fileInfos))
for i, fileInfo := range fileInfos {
addresses = *new([][]byte)
for _, fileInfo := range fileInfos {
address, err := hex.DecodeString(fileInfo.Name())
if err != nil {
continue
}
addresses[i] = address
addresses = append(addresses, address)
}
return addresses, err
}