예제 #1
0
        private void createBlock2(ClientN2 client, Block previous, DAO.Ticket ticket)
        {
            log2.Debug("Adding Block to Node 2");
            var   reTicket = client.createTicket(ticket);
            Block block1   = new Block(previous.Hash, reTicket);

            log2.Debug(string.Format("Adding ticket from user {0}", reTicket.CustomerName));
            DAO.Block dBlock1 = new DAO.Block()
            {
                PreviousHash = block1.PreviousHash, Hash = block1.Hash, Id = 0, IdTicket = block1.Ticket.Id
            };
            client.createBlock(dBlock1);
        }
예제 #2
0
        private void createGenesisBlock2(ClientN2 client, DAO.Ticket daoTicket, DAO.Block daoBlock)
        {
            log2.Debug("Creating Genesis Block for Node 2");
            DAO.Ticket t1       = daoTicket;
            var        reTicket = client.createTicket(t1);
            Block      block1   = new Block(null, t1);

            daoBlock.PreviousHash = block1.PreviousHash;
            daoBlock.Hash         = block1.Hash;
            daoBlock.Id           = 0;
            daoBlock.IdTicket     = block1.Ticket.Id;
            client.createBlock(daoBlock);
        }