Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
a0d203a8
Commit
a0d203a8
authored
Nov 27, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2011 from karalabe/fix-hex-address
common: fix #2008, wrong hex prefix check
parents
7dde2b90
18ea468c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
types.go
common/types.go
+2
-2
No files found.
common/types.go
View file @
a0d203a8
...
@@ -95,10 +95,10 @@ func HexToAddress(s string) Address { return BytesToAddress(FromHex(s)) }
...
@@ -95,10 +95,10 @@ func HexToAddress(s string) Address { return BytesToAddress(FromHex(s)) }
// IsHexAddress verifies whether a string can represent a valid hex-encoded
// IsHexAddress verifies whether a string can represent a valid hex-encoded
// Ethereum address or not.
// Ethereum address or not.
func
IsHexAddress
(
s
string
)
bool
{
func
IsHexAddress
(
s
string
)
bool
{
if
len
(
s
)
==
2
+
2
*
AddressLength
&&
IsHex
(
s
[
2
:
]
)
{
if
len
(
s
)
==
2
+
2
*
AddressLength
&&
IsHex
(
s
)
{
return
true
return
true
}
}
if
len
(
s
)
==
2
*
AddressLength
&&
IsHex
(
s
)
{
if
len
(
s
)
==
2
*
AddressLength
&&
IsHex
(
"0x"
+
s
)
{
return
true
return
true
}
}
return
false
return
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment