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
40a2c523
Commit
40a2c523
authored
May 29, 2018
by
Smilenator
Committed by
Péter Szilágyi
May 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/fetcher: reuse variables for hash and number (#16819)
parent
a9c6ef69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
fetcher.go
eth/fetcher/fetcher.go
+4
-4
No files found.
eth/fetcher/fetcher.go
View file @
40a2c523
...
...
@@ -292,20 +292,20 @@ func (f *Fetcher) loop() {
height
:=
f
.
chainHeight
()
for
!
f
.
queue
.
Empty
()
{
op
:=
f
.
queue
.
PopItem
()
.
(
*
inject
)
hash
:=
op
.
block
.
Hash
()
if
f
.
queueChangeHook
!=
nil
{
f
.
queueChangeHook
(
op
.
block
.
Hash
()
,
false
)
f
.
queueChangeHook
(
hash
,
false
)
}
// If too high up the chain or phase, continue later
number
:=
op
.
block
.
NumberU64
()
if
number
>
height
+
1
{
f
.
queue
.
Push
(
op
,
-
float32
(
op
.
block
.
NumberU64
()
))
f
.
queue
.
Push
(
op
,
-
float32
(
number
))
if
f
.
queueChangeHook
!=
nil
{
f
.
queueChangeHook
(
op
.
block
.
Hash
()
,
true
)
f
.
queueChangeHook
(
hash
,
true
)
}
break
}
// Otherwise if fresh and still unknown, try and import
hash
:=
op
.
block
.
Hash
()
if
number
+
maxUncleDist
<
height
||
f
.
getBlock
(
hash
)
!=
nil
{
f
.
forgetBlock
(
hash
)
continue
...
...
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