Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
whqwjb
go-ethereum
提交
234cc8e7
G
go-ethereum
项目概览
whqwjb
/
go-ethereum
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
go-ethereum
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
234cc8e7
编写于
5月 06, 2020
作者:
G
Guillaume Ballet
提交者:
GitHub
5月 06, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
eth/downloader: minor typo fixes in comments (#21035)
上级
5cdc2dff
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
8 deletion
+7
-8
eth/downloader/downloader.go
eth/downloader/downloader.go
+2
-2
eth/downloader/downloader_test.go
eth/downloader/downloader_test.go
+1
-1
eth/downloader/queue.go
eth/downloader/queue.go
+2
-3
trie/sync.go
trie/sync.go
+2
-2
未找到文件。
eth/downloader/downloader.go
浏览文件 @
234cc8e7
...
@@ -361,7 +361,7 @@ func (d *Downloader) synchronise(id string, hash common.Hash, td *big.Int, mode
...
@@ -361,7 +361,7 @@ func (d *Downloader) synchronise(id string, hash common.Hash, td *big.Int, mode
log
.
Info
(
"Block synchronisation started"
)
log
.
Info
(
"Block synchronisation started"
)
}
}
// If we are already full syncing, but have a fast-sync bloom filter laying
// 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.
// when the user attempts to fast sync a new empty network.
if
mode
==
FullSync
&&
d
.
stateBloom
!=
nil
{
if
mode
==
FullSync
&&
d
.
stateBloom
!=
nil
{
d
.
stateBloom
.
Close
()
d
.
stateBloom
.
Close
()
...
@@ -665,7 +665,7 @@ func calculateRequestSpan(remoteHeight, localHeight uint64) (int64, int, int, ui
...
@@ -665,7 +665,7 @@ func calculateRequestSpan(remoteHeight, localHeight uint64) (int64, int, int, ui
requestHead
=
0
requestHead
=
0
}
}
// requestBottom is the lowest block we want included in the query
// 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
)
requestBottom
:=
int
(
localHeight
-
1
)
if
requestBottom
<
0
{
if
requestBottom
<
0
{
requestBottom
=
0
requestBottom
=
0
...
...
eth/downloader/downloader_test.go
浏览文件 @
234cc8e7
...
@@ -1126,7 +1126,7 @@ func testBlockHeaderAttackerDropping(t *testing.T, protocol int) {
...
@@ -1126,7 +1126,7 @@ func testBlockHeaderAttackerDropping(t *testing.T, protocol int) {
chain
:=
testChainBase
.
shorten
(
1
)
chain
:=
testChainBase
.
shorten
(
1
)
for
i
,
tt
:=
range
tests
{
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
)
id
:=
fmt
.
Sprintf
(
"test %d"
,
i
)
if
err
:=
tester
.
newPeer
(
id
,
protocol
,
chain
);
err
!=
nil
{
if
err
:=
tester
.
newPeer
(
id
,
protocol
,
chain
);
err
!=
nil
{
t
.
Fatalf
(
"test %d: failed to register new peer: %v"
,
i
,
err
)
t
.
Fatalf
(
"test %d: failed to register new peer: %v"
,
i
,
err
)
...
...
eth/downloader/queue.go
浏览文件 @
234cc8e7
...
@@ -234,8 +234,7 @@ func (q *queue) ShouldThrottleReceipts() bool {
...
@@ -234,8 +234,7 @@ func (q *queue) ShouldThrottleReceipts() bool {
}
}
// resultSlots calculates the number of results slots available for requests
// resultSlots calculates the number of results slots available for requests
// whilst adhering to both the item and the memory limit too of the results
// whilst adhering to both the item and the memory limits of the result cache.
// cache.
func
(
q
*
queue
)
resultSlots
(
pendPool
map
[
string
]
*
fetchRequest
,
donePool
map
[
common
.
Hash
]
struct
{})
int
{
func
(
q
*
queue
)
resultSlots
(
pendPool
map
[
string
]
*
fetchRequest
,
donePool
map
[
common
.
Hash
]
struct
{})
int
{
// Calculate the maximum length capped by the memory limit
// Calculate the maximum length capped by the memory limit
limit
:=
len
(
q
.
resultCache
)
limit
:=
len
(
q
.
resultCache
)
...
@@ -348,7 +347,7 @@ func (q *queue) Schedule(headers []*types.Header, from uint64) []*types.Header {
...
@@ -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
// 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
{
func
(
q
*
queue
)
Results
(
block
bool
)
[]
*
fetchResult
{
q
.
lock
.
Lock
()
q
.
lock
.
Lock
()
defer
q
.
lock
.
Unlock
()
defer
q
.
lock
.
Unlock
()
...
...
trie/sync.go
浏览文件 @
234cc8e7
...
@@ -174,8 +174,8 @@ func (s *Sync) Missing(max int) []common.Hash {
...
@@ -174,8 +174,8 @@ func (s *Sync) Missing(max int) []common.Hash {
}
}
// Process injects a batch of retrieved trie nodes data, returning if something
// 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
// was committed to the database and also the index of an entry if
its processing
//
it
failed.
// failed.
func
(
s
*
Sync
)
Process
(
results
[]
SyncResult
)
(
bool
,
int
,
error
)
{
func
(
s
*
Sync
)
Process
(
results
[]
SyncResult
)
(
bool
,
int
,
error
)
{
committed
:=
false
committed
:=
false
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录