Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
token-bridge
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
movabridge
token-bridge
Commits
86e0d815
Commit
86e0d815
authored
Aug 20, 2025
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update sync
parent
6e9e1227
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
sync.go
chain/sync.go
+6
-4
No files found.
chain/sync.go
View file @
86e0d815
...
@@ -60,7 +60,7 @@ func (s *ChainSync) loop() {
...
@@ -60,7 +60,7 @@ func (s *ChainSync) loop() {
var
latestHeight
int64
var
latestHeight
int64
var
beginHeight
=
finishedHeight
+
1
var
beginHeight
=
finishedHeight
+
1
var
endHeight
=
beginHeight
+
int64
(
s
.
chain
.
BatchBlock
)
log
.
WithField
(
"chain"
,
s
.
name
)
.
WithField
(
"begin height"
,
beginHeight
)
.
Info
(
"last validator block height"
)
log
.
WithField
(
"chain"
,
s
.
name
)
.
WithField
(
"begin height"
,
beginHeight
)
.
Info
(
"last validator block height"
)
tm
:=
time
.
NewTicker
(
time
.
Second
)
tm
:=
time
.
NewTicker
(
time
.
Second
)
...
@@ -69,9 +69,12 @@ func (s *ChainSync) loop() {
...
@@ -69,9 +69,12 @@ func (s *ChainSync) loop() {
for
{
for
{
select
{
select
{
case
<-
s
.
quit
:
case
<-
s
.
quit
:
log
.
WithField
(
"chain"
,
s
.
name
)
.
Info
(
"chain sync stopped"
)
log
.
WithField
(
"chain"
,
s
.
name
)
.
Info
(
"chain sync stopped"
)
return
return
case
<-
tm
.
C
:
case
<-
tm
.
C
:
var
endHeight
=
beginHeight
+
int64
(
s
.
chain
.
BatchBlock
)
latestHeight
,
err
=
s
.
d
.
GetBlockHeight
(
s
.
chain
,
s
.
chain
.
BehindBlock
)
latestHeight
,
err
=
s
.
d
.
GetBlockHeight
(
s
.
chain
,
s
.
chain
.
BehindBlock
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
WithField
(
"chain"
,
s
.
name
)
.
WithError
(
err
)
.
Error
(
"get latest block height"
)
log
.
WithField
(
"chain"
,
s
.
name
)
.
WithError
(
err
)
.
Error
(
"get latest block height"
)
...
@@ -96,15 +99,14 @@ func (s *ChainSync) loop() {
...
@@ -96,15 +99,14 @@ func (s *ChainSync) loop() {
if
err
=
s
.
d
.
SetStorageHeight
(
s
.
heightKey
,
endHeight
);
err
!=
nil
{
if
err
=
s
.
d
.
SetStorageHeight
(
s
.
heightKey
,
endHeight
);
err
!=
nil
{
log
.
WithField
(
"chain"
,
s
.
name
)
.
WithError
(
err
)
.
Error
(
"set last block height"
)
log
.
WithField
(
"chain"
,
s
.
name
)
.
WithError
(
err
)
.
Error
(
"set last block height"
)
}
}
beginHeight
=
endHeight
+
1
endHeight
=
beginHeight
+
int64
(
s
.
chain
.
BatchBlock
)
log
.
WithField
(
"chain"
,
s
.
name
)
.
WithFields
(
log
.
Fields
{
log
.
WithField
(
"chain"
,
s
.
name
)
.
WithFields
(
log
.
Fields
{
"begin height"
:
beginHeight
,
"begin height"
:
beginHeight
,
"end height"
:
endHeight
,
"end height"
:
endHeight
,
"latest height"
:
latestHeight
,
"latest height"
:
latestHeight
,
"diff height"
:
latestHeight
-
endHeight
,
"diff height"
:
latestHeight
-
endHeight
,
})
.
Info
(
"validator block"
)
})
.
Info
(
"validator block"
)
beginHeight
=
endHeight
+
1
}
}
}
}
}
}
...
...
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