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
983cb25a
Unverified
Commit
983cb25a
authored
Aug 07, 2020
by
Martin Holst Swende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
les: update checktime even if check fails
parent
68754f39
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
oracle.go
les/checkpointoracle/oracle.go
+5
-3
No files found.
les/checkpointoracle/oracle.go
View file @
983cb25a
...
...
@@ -93,8 +93,11 @@ func (oracle *CheckpointOracle) StableCheckpoint() (*params.TrustedCheckpoint, u
// Look it up properly
// Retrieve the latest checkpoint from the contract, abort if empty
latest
,
hash
,
height
,
err
:=
oracle
.
contract
.
Contract
()
.
GetLatestCheckpoint
(
nil
)
oracle
.
lastCheckTime
=
time
.
Now
()
if
err
!=
nil
||
(
latest
==
0
&&
hash
==
[
32
]
byte
{})
{
return
nil
,
0
oracle
.
lastCheckPointHeight
=
0
oracle
.
lastCheckPoint
=
nil
return
oracle
.
lastCheckPoint
,
oracle
.
lastCheckPointHeight
}
local
:=
oracle
.
getLocal
(
latest
)
...
...
@@ -106,10 +109,9 @@ func (oracle *CheckpointOracle) StableCheckpoint() (*params.TrustedCheckpoint, u
//
// In both cases, no stable checkpoint will be returned.
if
local
.
HashEqual
(
hash
)
{
oracle
.
lastCheckTime
=
time
.
Now
()
oracle
.
lastCheckPointHeight
=
height
.
Uint64
()
oracle
.
lastCheckPoint
=
&
local
return
&
local
,
height
.
Uint64
()
return
oracle
.
lastCheckPoint
,
oracle
.
lastCheckPointHeight
}
return
nil
,
0
}
...
...
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