diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-11-28 01:32:46 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-11-28 01:32:46 +0800 |
commit | 18ea468cf8c2a82d3c1310c81a6389cd7c019fc7 (patch) | |
tree | 485917f3cb83b35f5b2f579cebb38fba3f7f7e1b /common | |
parent | 7dde2b902cf81e90b484b1a48f6d45e0abd10e0f (diff) | |
download | dexon-18ea468cf8c2a82d3c1310c81a6389cd7c019fc7.tar dexon-18ea468cf8c2a82d3c1310c81a6389cd7c019fc7.tar.gz dexon-18ea468cf8c2a82d3c1310c81a6389cd7c019fc7.tar.bz2 dexon-18ea468cf8c2a82d3c1310c81a6389cd7c019fc7.tar.lz dexon-18ea468cf8c2a82d3c1310c81a6389cd7c019fc7.tar.xz dexon-18ea468cf8c2a82d3c1310c81a6389cd7c019fc7.tar.zst dexon-18ea468cf8c2a82d3c1310c81a6389cd7c019fc7.zip |
common: fix #2008, wrong hex prefix check
Diffstat (limited to 'common')
-rw-r--r-- | common/types.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/types.go b/common/types.go index ea5838188..acbd5b28d 100644 --- a/common/types.go +++ b/common/types.go @@ -95,10 +95,10 @@ func HexToAddress(s string) Address { return BytesToAddress(FromHex(s)) } // IsHexAddress verifies whether a string can represent a valid hex-encoded // Ethereum address or not. func IsHexAddress(s string) bool { - if len(s) == 2+2*AddressLength && IsHex(s[2:]) { + if len(s) == 2+2*AddressLength && IsHex(s) { return true } - if len(s) == 2*AddressLength && IsHex(s) { + if len(s) == 2*AddressLength && IsHex("0x"+s) { return true } return false |