Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
9a31b596
Commit
9a31b596
authored
Jun 20, 2019
by
mdj33
Committed by
vipwzw
Jun 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add fork to para filter
parent
a2362420
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
action.go
plugin/dapp/paracross/executor/action.go
+7
-3
filtertxs.go
plugin/dapp/paracross/executor/filtertxs.go
+14
-5
No files found.
plugin/dapp/paracross/executor/action.go
View file @
9a31b596
...
...
@@ -224,15 +224,19 @@ func hasCommited(addrs []string, addr string) (bool, int) {
return
false
,
0
}
func
getDappForkHeight
(
fork
string
)
int64
{
func
getDappForkHeight
(
fork
Key
string
)
int64
{
var
forkHeight
int64
if
types
.
IsPara
()
{
forkHeight
=
types
.
Conf
(
"config.consensus.sub.para"
)
.
GInt
(
"MainForkParacrossCommitTx"
)
key
:=
forkKey
if
forkKey
==
pt
.
ForkCommitTx
{
key
=
"MainForkParacrossCommitTx"
}
forkHeight
=
types
.
Conf
(
"config.consensus.sub.para"
)
.
GInt
(
key
)
if
forkHeight
<=
0
{
forkHeight
=
types
.
MaxHeight
}
}
else
{
forkHeight
=
types
.
GetDappFork
(
pt
.
ParaX
,
fork
)
forkHeight
=
types
.
GetDappFork
(
pt
.
ParaX
,
fork
Key
)
}
return
forkHeight
}
...
...
plugin/dapp/paracross/executor/filtertxs.go
View file @
9a31b596
...
...
@@ -46,7 +46,7 @@ func checkReceiptExecOk(receipt *types.ReceiptData) bool {
// 1, 主链+平行链 user.p.xx.paracross 交易组 混合跨链资产转移 paracross主链执行成功
// 2, 平行链 user.p.xx.paracross + user.p.xx.other 混合平行链组合 paracross主链执行成功
// 3, 平行链 user.p.xx.other 交易组 混合平行链组合 other主链pack
func
filterParaTxGroup
(
title
string
,
tx
*
types
.
Transaction
,
main
*
types
.
BlockDetail
,
index
int
)
([]
*
types
.
Transaction
,
int
)
{
func
filterParaTxGroup
(
title
string
,
tx
*
types
.
Transaction
,
main
*
types
.
BlockDetail
,
index
int
,
forkHeight
int64
)
([]
*
types
.
Transaction
,
int
)
{
var
headIdx
int
for
i
:=
index
;
i
>=
0
;
i
--
{
...
...
@@ -58,6 +58,12 @@ func filterParaTxGroup(title string, tx *types.Transaction, main *types.BlockDet
endIdx
:=
headIdx
+
int
(
tx
.
GroupCount
)
for
i
:=
headIdx
;
i
<
endIdx
;
i
++
{
if
types
.
IsPara
()
&&
main
.
Block
.
Height
<
forkHeight
{
if
types
.
IsMyParaExecName
(
string
(
main
.
Block
.
Txs
[
i
]
.
Execer
))
{
continue
}
}
if
!
checkReceiptExecOk
(
main
.
Receipts
[
i
])
{
return
nil
,
endIdx
}
...
...
@@ -69,18 +75,21 @@ func filterParaTxGroup(title string, tx *types.Transaction, main *types.BlockDet
//FilterTxsForPara include some main tx in tx group before ForkParacrossCommitTx
func
FilterTxsForPara
(
title
string
,
main
*
types
.
BlockDetail
)
[]
*
types
.
Transaction
{
var
txs
[]
*
types
.
Transaction
forkHeight
:=
getDappForkHeight
(
pt
.
ForkCommitTx
)
for
i
:=
0
;
i
<
len
(
main
.
Block
.
Txs
);
i
++
{
tx
:=
main
.
Block
.
Txs
[
i
]
if
types
.
IsSpecificParaExecName
(
title
,
string
(
tx
.
Execer
))
{
if
tx
.
GroupCount
>=
2
{
mainTxs
,
endIdx
:=
filterParaTxGroup
(
title
,
tx
,
main
,
i
)
mainTxs
,
endIdx
:=
filterParaTxGroup
(
title
,
tx
,
main
,
i
,
forkHeight
)
txs
=
append
(
txs
,
mainTxs
...
)
i
=
endIdx
-
1
continue
}
//单独的paracross跨链合约 如果主链执行失败也要排除
if
bytes
.
HasSuffix
(
tx
.
Execer
,
[]
byte
(
pt
.
ParaX
))
&&
!
checkReceiptExecOk
(
main
.
Receipts
[
i
])
{
continue
//单独的paracross tx 如果主链执行失败也要排除
if
main
.
Block
.
Height
>=
forkHeight
{
if
types
.
IsMyParaExecName
(
string
(
tx
.
Execer
))
&&
!
checkReceiptExecOk
(
main
.
Receipts
[
i
])
{
continue
}
}
txs
=
append
(
txs
,
tx
)
...
...
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