diff options
author | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-02-25 01:03:10 +0800 |
---|---|---|
committer | Gustav Simonsson <gustav.simonsson@gmail.com> | 2015-02-25 01:05:10 +0800 |
commit | 923950ccaaa4f9c1c0cebfbdd99fb0f16c47fd37 (patch) | |
tree | 8b268fcfcf2585c38db00d57b5bf5da4c2040473 /crypto/key_store_plain.go | |
parent | 91a8c08f037c1ec737d15ce00c6720015347e0d6 (diff) | |
download | dexon-923950ccaaa4f9c1c0cebfbdd99fb0f16c47fd37.tar.gz dexon-923950ccaaa4f9c1c0cebfbdd99fb0f16c47fd37.tar.zst dexon-923950ccaaa4f9c1c0cebfbdd99fb0f16c47fd37.zip |
Fix key store address hex decoding and accounts test
Thanks to https://github.com/jaekwon for original fix!
Diffstat (limited to 'crypto/key_store_plain.go')
-rw-r--r-- | crypto/key_store_plain.go | 7 |
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 } |