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
83d16574
Commit
83d16574
authored
Jan 09, 2018
by
Felföldi Zsolt
Committed by
Felix Lange
Jan 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
les: fix les/1 CHT compatibility issue (#15692)
parent
9d06026c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
handler.go
les/handler.go
+2
-2
peer.go
les/peer.go
+1
-1
No files found.
les/handler.go
View file @
83d16574
...
...
@@ -846,8 +846,8 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
}
if
header
:=
pm
.
blockchain
.
GetHeaderByNumber
(
req
.
BlockNum
);
header
!=
nil
{
sectionHead
:=
core
.
GetCanonicalHash
(
pm
.
chainDb
,
(
req
.
ChtNum
+
1
)
*
light
.
ChtV1Frequency
-
1
)
if
root
:=
light
.
GetChtRoot
(
pm
.
chainDb
,
req
.
ChtNum
,
sectionHead
);
root
!=
(
common
.
Hash
{})
{
sectionHead
:=
core
.
GetCanonicalHash
(
pm
.
chainDb
,
req
.
ChtNum
*
light
.
ChtV1Frequency
-
1
)
if
root
:=
light
.
GetChtRoot
(
pm
.
chainDb
,
req
.
ChtNum
-
1
,
sectionHead
);
root
!=
(
common
.
Hash
{})
{
if
tr
,
_
:=
trie
.
New
(
root
,
trieDb
);
tr
!=
nil
{
var
encNumber
[
8
]
byte
binary
.
BigEndian
.
PutUint64
(
encNumber
[
:
],
req
.
BlockNum
)
...
...
les/peer.go
View file @
83d16574
...
...
@@ -296,7 +296,7 @@ func (p *peer) RequestHelperTrieProofs(reqID, cost uint64, reqs []HelperTrieReq)
}
blockNum
:=
binary
.
BigEndian
.
Uint64
(
req
.
Key
)
// convert HelperTrie request to old CHT request
reqsV1
[
i
]
=
ChtReq
{
ChtNum
:
(
req
.
TrieIdx
+
1
)
*
(
light
.
ChtFrequency
/
light
.
ChtV1Frequency
)
-
1
,
BlockNum
:
blockNum
,
FromLevel
:
req
.
FromLevel
}
reqsV1
[
i
]
=
ChtReq
{
ChtNum
:
(
req
.
TrieIdx
+
1
)
*
(
light
.
ChtFrequency
/
light
.
ChtV1Frequency
)
,
BlockNum
:
blockNum
,
FromLevel
:
req
.
FromLevel
}
}
return
sendRequest
(
p
.
rw
,
GetHeaderProofsMsg
,
reqID
,
cost
,
reqsV1
)
case
lpv2
:
...
...
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