mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 19:30:44 +00:00
Update history_trienode_utils.go
This commit is contained in:
parent
777265620d
commit
69ca8277b0
1 changed files with 2 additions and 5 deletions
|
|
@ -82,14 +82,11 @@ func hexPathNodeID(path string) uint16 {
|
||||||
offset = uint16(0)
|
offset = uint16(0)
|
||||||
pow = uint16(1)
|
pow = uint16(1)
|
||||||
value = uint16(0)
|
value = uint16(0)
|
||||||
bytes = []byte(path)
|
|
||||||
)
|
)
|
||||||
for i := 0; i < len(bytes); i++ {
|
for i := 0; i < len(path); i++ {
|
||||||
offset += pow
|
offset += pow
|
||||||
pow *= 16
|
pow *= 16
|
||||||
}
|
value = value*16 + uint16(path[i])
|
||||||
for i := 0; i < len(bytes); i++ {
|
|
||||||
value = value*16 + uint16(bytes[i])
|
|
||||||
}
|
}
|
||||||
return offset + value
|
return offset + value
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue