mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 13:47:19 +00:00
examples: additional check for IPv6 completeness
See neo-project/non-native-contracts#4.
This commit is contained in:
parent
04bbeccca6
commit
137d1a3ac1
1 changed files with 3 additions and 0 deletions
|
@ -613,6 +613,9 @@ func checkIPv6(data string) bool {
|
|||
nums[idx] = n
|
||||
}
|
||||
}
|
||||
if l < 8 && !hasEmpty {
|
||||
return false
|
||||
}
|
||||
|
||||
f0 := nums[0]
|
||||
if f0 < 0x2000 || f0 == 0x2002 || f0 == 0x3ffe || f0 > 0x3fff { // IPv6 Global Unicast https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml
|
||||
|
|
Loading…
Reference in a new issue