Esempio n. 1
0
        private void sendDataTo <T>(TcpClient client, T data)
        {
            string json = JMessage.Serialize(JMessage.FromValue(data));

            byte[] jsonData = asen.GetBytes(json);

            if (client != null)
            {
                client.Client.Send(BitConverter.GetBytes(jsonData.Length));
                client.Client.Send(jsonData);
            }
        }
Esempio n. 2
0
        public void startFindPOW()
        {
            Console.WriteLine("Starting POW working thread");
            TinyBlock genesisblock = new TinyBlock();

            string json = JMessage.Serialize(JMessage.FromValue(genesisblock));

            Console.WriteLine(json);
            Console.WriteLine(genesisblock.Serialize());
            blockchain.Add(genesisblock);

            ThreadStart ts = new ThreadStart(FindPOW);

            POWsearchThread = new Thread(ts);
            POWsearchThread.Start();
        }