aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-02 02:08:32 +0800
committerobscuren <geffobscura@gmail.com>2014-07-02 02:08:32 +0800
commit6151ae7db5251436e9ece190eb3569d4aa882671 (patch)
tree6f6cabb52394697740d76564d40aed441093dfb2
parent3889785017a1381d215cb1dc47fd5fb5b38add79 (diff)
downloadgo-tangerine-6151ae7db5251436e9ece190eb3569d4aa882671.tar.gz
go-tangerine-6151ae7db5251436e9ece190eb3569d4aa882671.tar.zst
go-tangerine-6151ae7db5251436e9ece190eb3569d4aa882671.zip
Fixed key import for empty entries
-rw-r--r--ethcrypto/keyring.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/ethcrypto/keyring.go b/ethcrypto/keyring.go
index 277fa2134..d3399d13d 100644
--- a/ethcrypto/keyring.go
+++ b/ethcrypto/keyring.go
@@ -74,8 +74,12 @@ func NewKeyRingFromString(content string) (*KeyRing, error) {
} else if len(words) != 1 {
return nil, fmt.Errorf("Unrecognised key format")
}
- secrets = append(secrets, ethutil.Hex2Bytes(secret))
+
+ if len(secret) != 0 {
+ secrets = append(secrets, ethutil.Hex2Bytes(secret))
+ }
}
+
return NewKeyRingFromSecrets(secrets)
}