示例#1
0
文件: KzH.cs 项目: kzbsv/KzjHack
        static void Timer1_Tick(object sender, EventArgs e)
        {
            var timer1 = _MainForm.timer1;

            timer1.Enabled = false;
            try {
                if (_enableZmqTask != Zmq.IsRunning)
                {
                    if (_enableZmqTask)
                    {
                        WriteLine("ZMQ Start");
                        Zmq.StartZmq();
                    }
                    else
                    {
                        WriteLine("ZMQ Stop");
                        Zmq.StopZmq();
                    }
                }
                if (Blocks.IsStopping)
                {
                    _MainForm.tasksControl.cbBlockHeaders.Checked = false;
                    Blocks.IsStopping = false;
                }
                if (_enableBlockHeadersTask != Blocks.IsRunning)
                {
                    if (_enableBlockHeadersTask)
                    {
                        WriteLine("Block Headers Start");
                        Blocks.StartGetOldBlocks();
                    }
                    else
                    {
                        WriteLine("Block Headers Stop");
                        Blocks.StopGetOldBlocks();
                    }
                }
                if (_enableVerifyRawBlocksTask != RawBlocks.IsRunning)
                {
                    if (_enableVerifyRawBlocksTask)
                    {
                        WriteLine("Verify RawBlocks Start");
                        RawBlocks.StartVerifyRawBlocks();
                    }
                    else
                    {
                        WriteLine("Verify RawBlocks Stop");
                        RawBlocks.StopVerifyRawBlocks();
                    }
                }
            }
            catch (Exception ex) {
                WriteLine($"timer1_Tick: {ex.LastInnerMessage()}");
            }
            finally {
                timer1.Enabled = true;
            }
        }
示例#2
0
文件: Zmq.cs 项目: kzbsv/KzjHack
 public static void StartZmq()
 {
     _zmqRunning = true;
     Task.Run(async() => await Zmq.MainZmq(null));
 }