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
234cc8e7
Unverified
Commit
234cc8e7
authored
May 06, 2020
by
Guillaume Ballet
Committed by
GitHub
May 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth/downloader: minor typo fixes in comments (#21035)
parent
5cdc2dff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
downloader.go
eth/downloader/downloader.go
+2
-2
downloader_test.go
eth/downloader/downloader_test.go
+1
-1
queue.go
eth/downloader/queue.go
+2
-3
sync.go
trie/sync.go
+2
-2
No files found.
eth/downloader/downloader.go
View file @
234cc8e7
...
...
@@ -361,7 +361,7 @@ func (d *Downloader) synchronise(id string, hash common.Hash, td *big.Int, mode
log
.
Info
(
"Block synchronisation started"
)
}
// If we are already full syncing, but have a fast-sync bloom filter laying
// around, make sure it does't use memory any more. This is a special case
// around, make sure it does
n
't use memory any more. This is a special case
// when the user attempts to fast sync a new empty network.
if
mode
==
FullSync
&&
d
.
stateBloom
!=
nil
{
d
.
stateBloom
.
Close
()
...
...
@@ -665,7 +665,7 @@ func calculateRequestSpan(remoteHeight, localHeight uint64) (int64, int, int, ui
requestHead
=
0
}
// requestBottom is the lowest block we want included in the query
// Ideally, we want to include
just below
own head
// Ideally, we want to include
the one just below our
own head
requestBottom
:=
int
(
localHeight
-
1
)
if
requestBottom
<
0
{
requestBottom
=
0
...
...
eth/downloader/downloader_test.go
View file @
234cc8e7
...
...
@@ -1126,7 +1126,7 @@ func testBlockHeaderAttackerDropping(t *testing.T, protocol int) {
chain
:=
testChainBase
.
shorten
(
1
)
for
i
,
tt
:=
range
tests
{
// Register a new peer and ensure it
'
s presence
// Register a new peer and ensure its presence
id
:=
fmt
.
Sprintf
(
"test %d"
,
i
)
if
err
:=
tester
.
newPeer
(
id
,
protocol
,
chain
);
err
!=
nil
{
t
.
Fatalf
(
"test %d: failed to register new peer: %v"
,
i
,
err
)
...
...
eth/downloader/queue.go
View file @
234cc8e7
...
...
@@ -234,8 +234,7 @@ func (q *queue) ShouldThrottleReceipts() bool {
}
// resultSlots calculates the number of results slots available for requests
// whilst adhering to both the item and the memory limit too of the results
// cache.
// whilst adhering to both the item and the memory limits of the result cache.
func
(
q
*
queue
)
resultSlots
(
pendPool
map
[
string
]
*
fetchRequest
,
donePool
map
[
common
.
Hash
]
struct
{})
int
{
// Calculate the maximum length capped by the memory limit
limit
:=
len
(
q
.
resultCache
)
...
...
@@ -348,7 +347,7 @@ func (q *queue) Schedule(headers []*types.Header, from uint64) []*types.Header {
}
// Results retrieves and permanently removes a batch of fetch results from
// the cache.
t
he result slice will be empty if the queue has been closed.
// the cache.
T
he result slice will be empty if the queue has been closed.
func
(
q
*
queue
)
Results
(
block
bool
)
[]
*
fetchResult
{
q
.
lock
.
Lock
()
defer
q
.
lock
.
Unlock
()
...
...
trie/sync.go
View file @
234cc8e7
...
...
@@ -174,8 +174,8 @@ func (s *Sync) Missing(max int) []common.Hash {
}
// Process injects a batch of retrieved trie nodes data, returning if something
// was committed to the database and also the index of an entry if
processing of
//
it
failed.
// was committed to the database and also the index of an entry if
its processing
// failed.
func
(
s
*
Sync
)
Process
(
results
[]
SyncResult
)
(
bool
,
int
,
error
)
{
committed
:=
false
...
...
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