Beispiel #1
0
        private void createBlock3(ClientN3 client, Block previous, DAO.Ticket ticket)
        {
            log3.Debug("Adding Block to Node 3");
            var   reTicket = client.createTicket(ticket);
            Block block1   = new Block(previous.Hash, reTicket);

            log3.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);
        }
Beispiel #2
0
        private void createGenesisBlock3(ClientN3 client, DAO.Ticket daoTicket, DAO.Block daoBlock)
        {
            log3.Debug("Creating Genesis Block for Node 3");
            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);
        }