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
4f85c2b8
Unverified
Commit
4f85c2b8
authored
Feb 16, 2019
by
Martin Holst Swende
Committed by
GitHub
Feb 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trie: fix error in node decoding (#19111)
parent
5b8ae788
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
encoding.go
trie/encoding.go
+3
-0
trie_test.go
trie/trie_test.go
+13
-0
No files found.
trie/encoding.go
View file @
4f85c2b8
...
...
@@ -52,6 +52,9 @@ func hexToCompact(hex []byte) []byte {
}
func
compactToHex
(
compact
[]
byte
)
[]
byte
{
if
len
(
compact
)
==
0
{
return
compact
}
base
:=
keybytesToHex
(
compact
)
// delete terminator flag
if
base
[
0
]
<
2
{
...
...
trie/trie_test.go
View file @
4f85c2b8
...
...
@@ -614,3 +614,16 @@ func updateString(trie *Trie, k, v string) {
func
deleteString
(
trie
*
Trie
,
k
string
)
{
trie
.
Delete
([]
byte
(
k
))
}
func
TestDecodeNode
(
t
*
testing
.
T
)
{
t
.
Parallel
()
var
(
hash
=
make
([]
byte
,
20
)
elems
=
make
([]
byte
,
20
)
)
for
i
:=
0
;
i
<
5000000
;
i
++
{
rand
.
Read
(
hash
)
rand
.
Read
(
elems
)
decodeNode
(
hash
,
elems
,
1
)
}
}
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