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
efaabcdc
Commit
efaabcdc
authored
Aug 09, 2022
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
270e39f3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
paracross.go
paracross/paracross.go
+5
-5
No files found.
paracross/paracross.go
View file @
efaabcdc
...
@@ -57,7 +57,7 @@ type Paracross struct {
...
@@ -57,7 +57,7 @@ type Paracross struct {
db
*
util
.
KVDBList
// 记录已完成的hashID、高度等信息。
db
*
util
.
KVDBList
// 记录已完成的hashID、高度等信息。
// 模拟平行链节点
// 模拟平行链节点
paraHeight
*
atomic
.
Ui
nt64
// paraHeightHash = Hash(paraHeight)
paraHeight
*
atomic
.
I
nt64
// paraHeightHash = Hash(paraHeight)
grpcClient
types33
.
Chain33Client
grpcClient
types33
.
Chain33Client
sendMsgCh
chan
*
types33
.
Transaction
// 提交共识交易
sendMsgCh
chan
*
types33
.
Transaction
// 提交共识交易
privateKey
crypto
.
PrivKey
privateKey
crypto
.
PrivKey
...
@@ -77,7 +77,7 @@ type Paracross struct {
...
@@ -77,7 +77,7 @@ type Paracross struct {
logger
hclog
.
InterceptLogger
logger
hclog
.
InterceptLogger
}
}
func
(
p
*
Paracross
)
incParaHeight
()
u
int64
{
func
(
p
*
Paracross
)
incParaHeight
()
int64
{
h
:=
p
.
paraHeight
.
Inc
()
h
:=
p
.
paraHeight
.
Inc
()
value
:=
fmt
.
Sprintf
(
"%d"
,
h
)
value
:=
fmt
.
Sprintf
(
"%d"
,
h
)
_
=
p
.
db
.
Set
([]
byte
(
"latest-para-height"
),
[]
byte
(
value
))
_
=
p
.
db
.
Set
([]
byte
(
"latest-para-height"
),
[]
byte
(
value
))
...
@@ -160,7 +160,7 @@ func (p *Paracross) Initialize(configPath string, ID string, extra []byte) error
...
@@ -160,7 +160,7 @@ func (p *Paracross) Initialize(configPath string, ID string, extra []byte) error
p
.
title
=
chain33Config
.
Chain33
.
Title
p
.
title
=
chain33Config
.
Chain33
.
Title
p
.
MinTxFeeRate
=
chain33Config
.
Chain33
.
Fee
p
.
MinTxFeeRate
=
chain33Config
.
Chain33
.
Fee
p
.
isTest
=
chain33Config
.
Chain33
.
IsTest
p
.
isTest
=
chain33Config
.
Chain33
.
IsTest
p
.
paraHeight
=
atomic
.
New
Uint64
(
0
)
p
.
paraHeight
=
atomic
.
New
Int64
(
-
1
)
if
strings
.
ToUpper
(
chain33Config
.
Chain33
.
Symbol
)
==
"YCC"
{
if
strings
.
ToUpper
(
chain33Config
.
Chain33
.
Symbol
)
==
"YCC"
{
execAddress
,
err
:=
address
.
GetExecAddress
(
p
.
title
+
execer
,
2
)
execAddress
,
err
:=
address
.
GetExecAddress
(
p
.
title
+
execer
,
2
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -398,7 +398,7 @@ func (p *Paracross) processBlock(height, end int64) {
...
@@ -398,7 +398,7 @@ func (p *Paracross) processBlock(height, end int64) {
continue
END
continue
END
}
}
if
p
.
paraHeight
.
Load
()
==
uint64
(
status
.
Height
)
{
if
p
.
paraHeight
.
Load
()
==
status
.
Height
{
p
.
logger
.
Warn
(
"is syncing block"
,
"status"
,
util
.
FormatJSON
(
status
),
"current main height"
,
height
,
"para height"
,
status
.
Height
)
p
.
logger
.
Warn
(
"is syncing block"
,
"status"
,
util
.
FormatJSON
(
status
),
"current main height"
,
height
,
"para height"
,
status
.
Height
)
time
.
Sleep
(
time
.
Second
)
time
.
Sleep
(
time
.
Second
)
continue
END
continue
END
...
@@ -412,7 +412,7 @@ func (p *Paracross) processBlock(height, end int64) {
...
@@ -412,7 +412,7 @@ func (p *Paracross) processBlock(height, end int64) {
}
}
err
=
p
.
commitTxStatus
(
commitStatus
,
hashData
)
err
=
p
.
commitTxStatus
(
commitStatus
,
hashData
)
if
err
==
nil
{
if
err
==
nil
{
p
.
paraHeight
.
Store
(
uint64
(
status
.
Height
)
)
p
.
paraHeight
.
Store
(
status
.
Height
)
}
}
return
err
return
err
}
}
...
...
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