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
68be45e5
Commit
68be45e5
authored
Nov 16, 2018
by
Łukasz Kurowski
Committed by
Péter Szilágyi
Nov 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trie: return hasher to pool (#18116)
* trie: return hasher to pool * trie: minor code formatting fix
parent
ffe2fc3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
iterator.go
trie/iterator.go
+2
-0
proof.go
trie/proof.go
+2
-0
No files found.
trie/iterator.go
View file @
68be45e5
...
@@ -181,6 +181,8 @@ func (it *nodeIterator) LeafProof() [][]byte {
...
@@ -181,6 +181,8 @@ func (it *nodeIterator) LeafProof() [][]byte {
if
len
(
it
.
stack
)
>
0
{
if
len
(
it
.
stack
)
>
0
{
if
_
,
ok
:=
it
.
stack
[
len
(
it
.
stack
)
-
1
]
.
node
.
(
valueNode
);
ok
{
if
_
,
ok
:=
it
.
stack
[
len
(
it
.
stack
)
-
1
]
.
node
.
(
valueNode
);
ok
{
hasher
:=
newHasher
(
0
,
0
,
nil
)
hasher
:=
newHasher
(
0
,
0
,
nil
)
defer
returnHasherToPool
(
hasher
)
proofs
:=
make
([][]
byte
,
0
,
len
(
it
.
stack
))
proofs
:=
make
([][]
byte
,
0
,
len
(
it
.
stack
))
for
i
,
item
:=
range
it
.
stack
[
:
len
(
it
.
stack
)
-
1
]
{
for
i
,
item
:=
range
it
.
stack
[
:
len
(
it
.
stack
)
-
1
]
{
...
...
trie/proof.go
View file @
68be45e5
...
@@ -66,6 +66,8 @@ func (t *Trie) Prove(key []byte, fromLevel uint, proofDb ethdb.Putter) error {
...
@@ -66,6 +66,8 @@ func (t *Trie) Prove(key []byte, fromLevel uint, proofDb ethdb.Putter) error {
}
}
}
}
hasher
:=
newHasher
(
0
,
0
,
nil
)
hasher
:=
newHasher
(
0
,
0
,
nil
)
defer
returnHasherToPool
(
hasher
)
for
i
,
n
:=
range
nodes
{
for
i
,
n
:=
range
nodes
{
// Don't bother checking for errors here since hasher panics
// Don't bother checking for errors here since hasher panics
// if encoding doesn't work and we're not writing to any database.
// if encoding doesn't work and we're not writing to any database.
...
...
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