Commit 703449dc authored by vipwzw's avatar vipwzw

auto ci

parent 14b1bbc3
...@@ -154,7 +154,7 @@ out: ...@@ -154,7 +154,7 @@ out:
case rsp := <-consensusCh: case rsp := <-consensusCh:
consensHeight := rsp.Height consensHeight := rsp.Height
plog.Info("para consensus rcv", "notify", notification, "sending", len(sendingMsgs), plog.Info("para consensus rcv", "notify", notification, "sending", len(sendingMsgs),
"consensHeigt", rsp.Height, "finished", finishHeight, "sync", isSync, "miner", readTick!=nil, "consensBlockHash", common.ToHex(rsp.BlockHash)) "consensHeigt", rsp.Height, "finished", finishHeight, "sync", isSync, "miner", readTick != nil, "consensBlockHash", common.ToHex(rsp.BlockHash))
if notification == nil || isRollback { if notification == nil || isRollback {
continue continue
...@@ -194,18 +194,18 @@ out: ...@@ -194,18 +194,18 @@ out:
} }
case miner := <-client.minerSwitch: case miner := <-client.minerSwitch:
plog.Info("para consensus mining","miner",miner) plog.Info("para consensus mining", "miner", miner)
//停止挖矿 //停止挖矿
if !miner{ if !miner {
readTick = nil readTick = nil
if ticker != nil{ if ticker != nil {
ticker.Stop() ticker.Stop()
} }
plog.Info("para consensus stop mining") plog.Info("para consensus stop mining")
continue continue
} }
//开启挖矿 //开启挖矿
if client.privateKey != nil && readTick == nil{ if client.privateKey != nil && readTick == nil {
ticker = time.NewTicker(time.Second * time.Duration(minerInterval)) ticker = time.NewTicker(time.Second * time.Duration(minerInterval))
readTick = ticker.C readTick = ticker.C
plog.Info("para consensus start mining") plog.Info("para consensus start mining")
...@@ -585,10 +585,10 @@ func (client *commitMsgClient) getConsensusStatus(block *types.Block) (*pt.Parac ...@@ -585,10 +585,10 @@ func (client *commitMsgClient) getConsensusStatus(block *types.Block) (*pt.Parac
} }
func (client *commitMsgClient) onWalletStatus(status *types.WalletStatus) { func (client *commitMsgClient) onWalletStatus(status *types.WalletStatus) {
if status == nil || client.paraClient.authAccount == ""{ if status == nil || client.paraClient.authAccount == "" {
return return
} }
if !status.IsWalletLock && client.privateKey == nil{ if !status.IsWalletLock && client.privateKey == nil {
client.fetchPriKey() client.fetchPriKey()
plog.Info("para commit fetchPriKey") plog.Info("para commit fetchPriKey")
} }
...@@ -599,13 +599,12 @@ func (client *commitMsgClient) onWalletStatus(status *types.WalletStatus) { ...@@ -599,13 +599,12 @@ func (client *commitMsgClient) onWalletStatus(status *types.WalletStatus) {
} }
} }
func (client *commitMsgClient) onWalletAccount(acc *types.Account) { func (client *commitMsgClient) onWalletAccount(acc *types.Account) {
if acc == nil || client.paraClient.authAccount == "" || client.paraClient.authAccount != acc.Addr || client.privateKey != nil{ if acc == nil || client.paraClient.authAccount == "" || client.paraClient.authAccount != acc.Addr || client.privateKey != nil {
return return
} }
err := client.fetchPriKey() err := client.fetchPriKey()
if err != nil{ if err != nil {
plog.Error("para commit fetchPriKey", "err", err.Error()) plog.Error("para commit fetchPriKey", "err", err.Error())
return return
} }
...@@ -616,7 +615,7 @@ func (client *commitMsgClient) onWalletAccount(acc *types.Account) { ...@@ -616,7 +615,7 @@ func (client *commitMsgClient) onWalletAccount(acc *types.Account) {
} }
} }
func (client *commitMsgClient) fetchPriKey() error { func (client *commitMsgClient) fetchPriKey() error {
req := &types.ReqString{Data: client.paraClient.authAccount} req := &types.ReqString{Data: client.paraClient.authAccount}
msg := client.paraClient.GetQueueClient().NewMessage("wallet", types.EventDumpPrivkey, req) msg := client.paraClient.GetQueueClient().NewMessage("wallet", types.EventDumpPrivkey, req)
...@@ -651,4 +650,3 @@ func (client *commitMsgClient) fetchPriKey() error { ...@@ -651,4 +650,3 @@ func (client *commitMsgClient) fetchPriKey() error {
plog.Info("para commit fetchPriKey success") plog.Info("para commit fetchPriKey success")
return nil return nil
} }
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