Commit 3d68184f authored by lilinleeli1234's avatar lilinleeli1234 Committed by vipwzw

update linter

parent 6c32070f
...@@ -50,25 +50,18 @@ func (mem *Mempool) SetQueueClient(client queue.Client) { ...@@ -50,25 +50,18 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
mlog.Info("Receive msg from para mempool") mlog.Info("Receive msg from para mempool")
if bytes.HasPrefix(msg.GetData().(*types.Transaction).Execer, types.ParaKey) { if bytes.HasPrefix(msg.GetData().(*types.Transaction).Execer, types.ParaKey) {
tx := msg.GetData().(*types.Transaction) tx := msg.GetData().(*types.Transaction)
var reply *types.Reply for i := 0; i < retry_times; i++ {
reply, err := mem.mainGrpcCli.SendTransaction(context.Background(), tx) reply, err := mem.mainGrpcCli.SendTransaction(context.Background(), tx)
if err != nil { if err == nil {
//进行重试 msg.Reply(client.NewMessage(mem.key, types.EventReply, &types.Reply{IsOk: true, Msg: []byte(reply.GetMsg())}))
for i := 0; i < retry_times; i++ { break
reply, err = mem.mainGrpcCli.SendTransaction(context.Background(), tx) } else if err != nil && i != retry_times-1 {
if err != nil { continue
continue } else {
} else {
break
}
}
if err != nil {
msg.Reply(client.NewMessage(mem.key, types.EventReply, &types.Reply{IsOk: false, msg.Reply(client.NewMessage(mem.key, types.EventReply, &types.Reply{IsOk: false,
Msg: []byte(fmt.Sprintf("Send transaction to main chain failed, %v", err))})) Msg: []byte(fmt.Sprintf("Send transaction to main chain failed, %v", err))}))
break
} }
} }
msg.Reply(client.NewMessage(mem.key, types.EventReply, &types.Reply{IsOk: true, Msg: []byte(reply.GetMsg())}))
} }
default: default:
msg.Reply(client.NewMessage(mem.key, types.EventReply, &types.Reply{IsOk: false, msg.Reply(client.NewMessage(mem.key, types.EventReply, &types.Reply{IsOk: false,
......
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