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
355fc47d
Commit
355fc47d
authored
Aug 21, 2018
by
Felföldi Zsolt
Committed by
Péter Szilágyi
Aug 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
les: fix CHT field in nodeInfo (#17465)
parent
76301ca0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
commons.go
les/commons.go
+16
-4
No files found.
les/commons.go
View file @
355fc47d
...
...
@@ -76,18 +76,30 @@ func (c *lesCommons) makeProtocols(versions []uint) []p2p.Protocol {
// nodeInfo retrieves some protocol metadata about the running host node.
func
(
c
*
lesCommons
)
nodeInfo
()
interface
{}
{
var
cht
light
.
TrustedCheckpoint
sections
,
_
,
sectionHead
:=
c
.
chtIndexer
.
Sections
()
sections2
,
_
,
sectionHead2
:=
c
.
bloomTrieIndexer
.
Sections
()
sections
,
_
,
_
:=
c
.
chtIndexer
.
Sections
()
sections2
,
_
,
_
:=
c
.
bloomTrieIndexer
.
Sections
()
if
!
c
.
protocolManager
.
lightSync
{
// convert to client section size if running in server mode
sections
/=
light
.
CHTFrequencyClient
/
light
.
CHTFrequencyServer
}
if
sections2
<
sections
{
sections
=
sections2
sectionHead
=
sectionHead2
}
if
sections
>
0
{
sectionIndex
:=
sections
-
1
sectionHead
:=
c
.
bloomTrieIndexer
.
SectionHead
(
sectionIndex
)
var
chtRoot
common
.
Hash
if
c
.
protocolManager
.
lightSync
{
chtRoot
=
light
.
GetChtRoot
(
c
.
chainDb
,
sectionIndex
,
sectionHead
)
}
else
{
chtRoot
=
light
.
GetChtV2Root
(
c
.
chainDb
,
sectionIndex
,
sectionHead
)
}
cht
=
light
.
TrustedCheckpoint
{
SectionIdx
:
sectionIndex
,
SectionHead
:
sectionHead
,
CHTRoot
:
light
.
GetChtRoot
(
c
.
chainDb
,
sectionIndex
,
sectionHead
)
,
CHTRoot
:
chtRoot
,
BloomRoot
:
light
.
GetBloomTrieRoot
(
c
.
chainDb
,
sectionIndex
,
sectionHead
),
}
}
...
...
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