Ejemplo n.º 1
0
        public void gen_ledger(int key, byte[] val)
        {
            byte[]    hash;
            block_obj genesis;

            hash    = mySHA256.ComputeHash(val);
            genesis = new block_obj(hash, key, val);
            ledger.Add(genesis);
        }
Ejemplo n.º 2
0
        public void add_block(int key, byte[] val)
        {
            byte[]    hash, current;
            block_obj newBlock;

            current  = new byte[val.Length + ledger.Last().hash.Length];
            hash     = mySHA256.ComputeHash(current);
            newBlock = new block_obj(hash, key, val);
            ledger.Add(newBlock);
        }