Commit 013d8a9e authored by hezhengjun's avatar hezhengjun

add withdrawProc

parent 3b585d22
...@@ -472,17 +472,21 @@ func (ethRelayer *Relayer4Ethereum) proc() { ...@@ -472,17 +472,21 @@ func (ethRelayer *Relayer4Ethereum) proc() {
ethRelayer.rwLock.RUnlock() ethRelayer.rwLock.RUnlock()
if nil != privateKey4Ethereum && nilAddr != ethRelayer.bridgeRegistryAddr { if nil != privateKey4Ethereum && nilAddr != ethRelayer.bridgeRegistryAddr {
relayerLog.Info("Ethereum relayer starts to run...") relayerLog.Info("Ethereum relayer starts to run...")
if ethRelayer.processWithDraw {
//对于是提币代理中继器,则不需要订阅相关的日志事件
goto withdrawProc
}
ethRelayer.prePareSubscribeEvent() ethRelayer.prePareSubscribeEvent()
//向bridgeBank订阅事件 //向bridgeBank订阅事件
ethRelayer.subscribeEvent() ethRelayer.subscribeEvent()
ethRelayer.filterLogEvents() ethRelayer.filterLogEvents()
relayerLog.Info("Ethereum relayer starts to process online log event...") relayerLog.Info("Ethereum relayer starts to process online log event...")
timer = time.NewTicker(time.Duration(ethRelayer.fetchHeightPeriodMs) * time.Millisecond) timer = time.NewTicker(time.Duration(ethRelayer.fetchHeightPeriodMs) * time.Millisecond)
goto latter goto burnLockProc
} }
} }
latter: burnLockProc:
for { for {
select { select {
case <-timer.C: case <-timer.C:
...@@ -497,6 +501,16 @@ latter: ...@@ -497,6 +501,16 @@ latter:
ethRelayer.handleChain33Msg(chain33Msg) 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) { func (ethRelayer *Relayer4Ethereum) handleChain33Msg(chain33Msg *events.Chain33Msg) {
...@@ -737,6 +751,11 @@ func (ethRelayer *Relayer4Ethereum) getCurrentHeight(ctx context.Context) (uint6 ...@@ -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) { func (ethRelayer *Relayer4Ethereum) procNewHeight(ctx context.Context) {
currentHeight, _ := ethRelayer.getCurrentHeight(ctx) currentHeight, _ := ethRelayer.getCurrentHeight(ctx)
ethRelayer.updateTxStatus() ethRelayer.updateTxStatus()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment