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
1aad521a
Commit
1aad521a
authored
Dec 27, 2021
by
hezhengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skip the old push
parent
b3cf20db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
proc.go
...ss2eth/ebrelayer/relayer/chain33/transceiver/sync/proc.go
+12
-9
No files found.
plugin/dapp/cross2eth/ebrelayer/relayer/chain33/transceiver/sync/proc.go
View file @
1aad521a
...
...
@@ -8,7 +8,6 @@ import (
dbm
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/types"
"github.com/33cn/plugin/plugin/dapp/cross2eth/ebrelayer/utils"
"github.com/pkg/errors"
)
// SeqType
...
...
@@ -106,13 +105,17 @@ func (syncTx *EVMTxLogs) SaveAndSyncTxs2Relayer() {
// 处理输入流程
func
(
syncTx
*
EVMTxLogs
)
dealEVMTxLogs
(
evmTxLogsInBlks
*
types
.
EVMTxLogsInBlks
)
{
count
,
start
,
evmTxLogsParsed
,
err
:=
parseEvmTxLogsInBlks
(
evmTxLogsInBlks
,
syncTx
.
seqNum
)
if
err
!=
nil
{
resultCh
<-
err
count
,
start
,
evmTxLogsParsed
:=
parseEvmTxLogsInBlks
(
evmTxLogsInBlks
,
syncTx
.
seqNum
)
txReceiptCount
:=
len
(
evmTxLogsParsed
)
//重复注册推送接收保护,允许同一个中继服务在使用一段时间后,使用不同的推送名字重新进行注册,这样重复推送忽略就可以
//需要进行ack,否则该节点的推送将会停止
if
0
==
txReceiptCount
{
resultCh
<-
nil
return
}
var
height
int64
for
i
:=
0
;
i
<
c
ount
;
i
++
{
for
i
:=
0
;
i
<
txReceiptC
ount
;
i
++
{
txsPerBlock
:=
evmTxLogsParsed
[
i
]
if
txsPerBlock
.
AddDelType
==
SeqTypeAdd
{
syncTx
.
setTxLogsPerBlock
(
txsPerBlock
)
...
...
@@ -206,7 +209,7 @@ func (syncTx *EVMTxLogs) delTxReceipts(height int64) {
}
// 检查输入是否有问题, 并解析输入
func
parseEvmTxLogsInBlks
(
evmTxLogs
*
types
.
EVMTxLogsInBlks
,
seqNumLast
int64
)
(
count
int
,
start
int64
,
txsWithReceipt
[]
*
types
.
EVMTxLogPerBlk
,
err
error
)
{
func
parseEvmTxLogsInBlks
(
evmTxLogs
*
types
.
EVMTxLogsInBlks
,
seqNumLast
int64
)
(
count
int
,
start
int64
,
txsWithReceipt
[]
*
types
.
EVMTxLogPerBlk
)
{
count
=
len
(
evmTxLogs
.
Logs4EVMPerBlk
)
txsWithReceipt
=
make
([]
*
types
.
EVMTxLogPerBlk
,
0
)
start
=
math
.
MaxInt64
...
...
@@ -230,9 +233,9 @@ func parseEvmTxLogsInBlks(evmTxLogs *types.EVMTxLogsInBlks, seqNumLast int64) (c
"height"
,
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
Height
,
"seqOpType"
,
seqOperationType
[
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
AddDelType
-
1
])
}
if
len
(
txsWithReceipt
)
!=
count
{
err
=
errors
.
New
(
"duplicate block's tx logs"
)
return
if
0
==
len
(
txsWithReceipt
)
{
log
.
Error
(
"parseEvmTxLogsInBlks"
,
"the valid number of tx receipt is"
,
0
)
}
return
}
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