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
03daf601
Unverified
Commit
03daf601
authored
Feb 08, 2018
by
Péter Szilágyi
Committed by
GitHub
Feb 08, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16037 from karalabe/light-startup-polishes
eth, light: minor light client startup cleanups
parents
1a4e6872
eb07dbb0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
9 deletions
+4
-9
downloader.go
eth/downloader/downloader.go
+0
-1
lightchain.go
light/lightchain.go
+1
-2
odr_util.go
light/odr_util.go
+1
-4
postprocess.go
light/postprocess.go
+2
-2
No files found.
eth/downloader/downloader.go
View file @
03daf601
...
...
@@ -266,7 +266,6 @@ func (d *Downloader) Synchronising() bool {
// RegisterPeer injects a new download peer into the set of block source to be
// used for fetching hashes and blocks from.
func
(
d
*
Downloader
)
RegisterPeer
(
id
string
,
version
int
,
peer
Peer
)
error
{
logger
:=
log
.
New
(
"peer"
,
id
)
logger
.
Trace
(
"Registering sync peer"
)
if
err
:=
d
.
peers
.
Register
(
newPeerConnection
(
id
,
version
,
peer
,
logger
));
err
!=
nil
{
...
...
light/lightchain.go
View file @
03daf601
...
...
@@ -100,7 +100,6 @@ func NewLightChain(odr OdrBackend, config *params.ChainConfig, engine consensus.
if
cp
,
ok
:=
trustedCheckpoints
[
bc
.
genesisBlock
.
Hash
()];
ok
{
bc
.
addTrustedCheckpoint
(
cp
)
}
if
err
:=
bc
.
loadLastState
();
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -128,7 +127,7 @@ func (self *LightChain) addTrustedCheckpoint(cp trustedCheckpoint) {
if
self
.
odr
.
BloomIndexer
()
!=
nil
{
self
.
odr
.
BloomIndexer
()
.
AddKnownSectionHead
(
cp
.
sectionIdx
,
cp
.
sectionHead
)
}
log
.
Info
(
"Added trusted checkpoint"
,
"chain
name"
,
cp
.
name
)
log
.
Info
(
"Added trusted checkpoint"
,
"chain
"
,
cp
.
name
,
"block"
,
(
cp
.
sectionIdx
+
1
)
*
ChtFrequency
-
1
,
"hash"
,
cp
.
sectionHead
)
}
func
(
self
*
LightChain
)
getProcInterrupt
()
bool
{
...
...
light/odr_util.go
View file @
03daf601
...
...
@@ -58,17 +58,14 @@ func GetHeaderByNumber(ctx context.Context, odr OdrBackend, number uint64) (*typ
}
}
}
if
number
>=
chtCount
*
ChtFrequency
{
return
nil
,
ErrNoTrustedCht
}
r
:=
&
ChtRequest
{
ChtRoot
:
GetChtRoot
(
db
,
chtCount
-
1
,
sectionHead
),
ChtNum
:
chtCount
-
1
,
BlockNum
:
number
}
if
err
:=
odr
.
Retrieve
(
ctx
,
r
);
err
!=
nil
{
return
nil
,
err
}
else
{
return
r
.
Header
,
nil
}
return
r
.
Header
,
nil
}
func
GetCanonicalHash
(
ctx
context
.
Context
,
odr
OdrBackend
,
number
uint64
)
(
common
.
Hash
,
error
)
{
...
...
light/postprocess.go
View file @
03daf601
...
...
@@ -52,7 +52,7 @@ type trustedCheckpoint struct {
var
(
mainnetCheckpoint
=
trustedCheckpoint
{
name
:
"
ETH
mainnet"
,
name
:
"mainnet"
,
sectionIdx
:
150
,
sectionHead
:
common
.
HexToHash
(
"1e2e67f289565cbe7bd4367f7960dbd73a3f7c53439e1047cd7ba331c8109e39"
),
chtRoot
:
common
.
HexToHash
(
"f2a6c9ca143d647b44523cc249f1072c8912358ab873a77a5fdc792b8df99e80"
),
...
...
@@ -60,7 +60,7 @@ var (
}
ropstenCheckpoint
=
trustedCheckpoint
{
name
:
"
Ropsten testnet
"
,
name
:
"
ropsten
"
,
sectionIdx
:
75
,
sectionHead
:
common
.
HexToHash
(
"12e68324f4578ea3e8e7fb3968167686729396c9279287fa1f1a8b51bb2d05b4"
),
chtRoot
:
common
.
HexToHash
(
"3e51dc095c69fa654a4cac766e0afff7357515b4b3c3a379c675f810363e54be"
),
...
...
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