aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-04-23 11:52:41 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-04-23 11:52:41 +0800
commit9d2a156453eeb8bb3c530244016740d5c2794427 (patch)
tree9d50f0ee8fd5b76ac5e2ddf4d6a5216b756843fc /crypto
parent94f2adb80a54c9bddacf146138d8e218a95629c9 (diff)
downloadgo-tangerine-9d2a156453eeb8bb3c530244016740d5c2794427.tar
go-tangerine-9d2a156453eeb8bb3c530244016740d5c2794427.tar.gz
go-tangerine-9d2a156453eeb8bb3c530244016740d5c2794427.tar.bz2
go-tangerine-9d2a156453eeb8bb3c530244016740d5c2794427.tar.lz
go-tangerine-9d2a156453eeb8bb3c530244016740d5c2794427.tar.xz
go-tangerine-9d2a156453eeb8bb3c530244016740d5c2794427.tar.zst
go-tangerine-9d2a156453eeb8bb3c530244016740d5c2794427.zip
Fix ignore of unexpected files in key dir
Diffstat (limited to 'crypto')
-rw-r--r--crypto/key_store_plain.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/key_store_plain.go b/crypto/key_store_plain.go
index 338a4a2c3..99e0fa440 100644
--- a/crypto/key_store_plain.go
+++ b/crypto/key_store_plain.go
@@ -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
}