aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/key_store_plain.go
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/key_store_plain.go')
-rw-r--r--crypto/key_store_plain.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/key_store_plain.go b/crypto/key_store_plain.go
index 255ae0ed7..338a4a2c3 100644
--- a/crypto/key_store_plain.go
+++ b/crypto/key_store_plain.go
@@ -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
}