Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sidecar-client-chain33
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
sidecar-client-chain33
Commits
bacdcf91
Commit
bacdcf91
authored
Jul 07, 2022
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
4d570a0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
22 deletions
+25
-22
paracross.go
paracross/paracross.go
+25
-22
No files found.
paracross/paracross.go
View file @
bacdcf91
...
...
@@ -355,33 +355,36 @@ func (p *Paracross) processBlock(height, end int64) {
p
.
logger
.
Error
(
"processBlock transaction error "
,
"hash"
,
util
.
ToHex
(
tx
.
Hash
()),
"txDetail:"
,
util
.
FormatJSON
(
txDetail
),
"height:"
,
height1
)
}
}
p
.
logger
.
Info
(
"deal height block end-----------------------"
,
"height"
,
height1
)
if
len
(
unDoneTx
)
>
0
{
// 再发起一次确认操作
// 提交模拟status commit事件
END
:
for
{
commitFun
:=
func
()
error
{
ret
,
err
:=
p
.
grpcClient
.
QueryChain
(
p
.
ctx
,
&
types33
.
ChainExecutor
{
Driver
:
execer
,
FuncName
:
"GetTitle"
,
Param
:
types33
.
Encode
(
&
types33
.
ReqString
{
Data
:
p
.
title
}),
})
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"ChainExecutor GetTitle error"
)
}
var
status
paracorssTypes
.
ParacrossStatus
err
=
types33
.
Decode
(
ret
.
Msg
,
&
status
)
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"ParacrossStatus decode error"
)
}
ret
,
err
:=
p
.
grpcClient
.
QueryChain
(
p
.
ctx
,
&
types33
.
ChainExecutor
{
Driver
:
execer
,
FuncName
:
"GetTitle"
,
Param
:
types33
.
Encode
(
&
types33
.
ReqString
{
Data
:
p
.
title
}),
})
if
err
!=
nil
{
p
.
logger
.
Error
(
"ChainExecutor GetTitle error"
,
"error"
,
err
)
continue
END
}
var
status
paracorssTypes
.
ParacrossStatus
err
=
types33
.
Decode
(
ret
.
Msg
,
&
status
)
if
err
!=
nil
{
p
.
logger
.
Error
(
"ParacrossStatus decode error"
,
"error"
,
err
)
continue
END
}
if
p
.
paraHeight
.
Load
()
==
uint64
(
status
.
Height
)
{
p
.
logger
.
Warn
(
"is syncing block"
,
"status"
,
util
.
FormatJSON
(
status
),
"current main height"
,
height
,
"para height"
,
status
.
Height
)
return
errors
.
New
(
"height sync block"
)
}
p
.
logger
.
Info
(
"ParacrossStatus"
,
"status"
,
util
.
FormatJSON
(
status
),
"current main height"
,
height
)
if
p
.
paraHeight
.
Load
()
==
uint64
(
status
.
Height
)
{
p
.
logger
.
Warn
(
"is syncing block"
,
"status"
,
util
.
FormatJSON
(
status
),
"current main height"
,
height
,
"para height"
,
status
.
Height
)
time
.
Sleep
(
time
.
Second
)
continue
END
}
p
.
logger
.
Info
(
"ParacrossStatus"
,
"status"
,
util
.
FormatJSON
(
status
),
"current main height"
,
height
)
commitFun
:=
func
()
error
{
commitStatus
,
err
:=
p
.
getNodeStatus
(
unDoneTx
,
blockDetail
,
status
.
Height
)
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"getNodeStatus error"
)
...
...
@@ -391,7 +394,6 @@ func (p *Paracross) processBlock(height, end int64) {
p
.
paraHeight
.
Store
(
uint64
(
status
.
Height
))
}
return
err
}
hash
:=
unDoneTx
[
0
]
result
,
err
:=
p
.
grpcClient
.
QueryChain
(
p
.
ctx
,
...
...
@@ -426,6 +428,7 @@ func (p *Paracross) processBlock(height, end int64) {
}
p
.
saveBlock
(
height1
,
blockDetail
)
p
.
incHeight
()
p
.
logger
.
Info
(
"deal height block end-----------------------"
,
"height"
,
height1
)
}
}
}
...
...
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