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
013d8a9e
Commit
013d8a9e
authored
Dec 21, 2021
by
hezhengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add withdrawProc
parent
3b585d22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
ethereum.go
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
+21
-2
No files found.
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
View file @
013d8a9e
...
...
@@ -472,17 +472,21 @@ func (ethRelayer *Relayer4Ethereum) proc() {
ethRelayer
.
rwLock
.
RUnlock
()
if
nil
!=
privateKey4Ethereum
&&
nilAddr
!=
ethRelayer
.
bridgeRegistryAddr
{
relayerLog
.
Info
(
"Ethereum relayer starts to run..."
)
if
ethRelayer
.
processWithDraw
{
//对于是提币代理中继器,则不需要订阅相关的日志事件
goto
withdrawProc
}
ethRelayer
.
prePareSubscribeEvent
()
//向bridgeBank订阅事件
ethRelayer
.
subscribeEvent
()
ethRelayer
.
filterLogEvents
()
relayerLog
.
Info
(
"Ethereum relayer starts to process online log event..."
)
timer
=
time
.
NewTicker
(
time
.
Duration
(
ethRelayer
.
fetchHeightPeriodMs
)
*
time
.
Millisecond
)
goto
latter
goto
burnLockProc
}
}
latter
:
burnLockProc
:
for
{
select
{
case
<-
timer
.
C
:
...
...
@@ -497,6 +501,16 @@ latter:
ethRelayer
.
handleChain33Msg
(
chain33Msg
)
}
}
withdrawProc
:
for
{
select
{
case
<-
timer
.
C
:
ethRelayer
.
procNewHeight4Withdraw
(
ctx
)
case
chain33Msg
:=
<-
ethRelayer
.
chain33MsgChan
:
ethRelayer
.
handleChain33Msg
(
chain33Msg
)
}
}
}
func
(
ethRelayer
*
Relayer4Ethereum
)
handleChain33Msg
(
chain33Msg
*
events
.
Chain33Msg
)
{
...
...
@@ -737,6 +751,11 @@ func (ethRelayer *Relayer4Ethereum) getCurrentHeight(ctx context.Context) (uint6
}
}
func
(
ethRelayer
*
Relayer4Ethereum
)
procNewHeight4Withdraw
(
ctx
context
.
Context
)
{
currentHeight
,
_
:=
ethRelayer
.
getCurrentHeight
(
ctx
)
relayerLog
.
Info
(
"procNewHeight4Withdraw"
,
"currentHeight"
,
currentHeight
)
}
func
(
ethRelayer
*
Relayer4Ethereum
)
procNewHeight
(
ctx
context
.
Context
)
{
currentHeight
,
_
:=
ethRelayer
.
getCurrentHeight
(
ctx
)
ethRelayer
.
updateTxStatus
()
...
...
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