Exemple #1
0
 public Bloock(int index, long timestamp, string previoushash, string data)
 {
     this.index        = index;
     this.timestamp    = timestamp;
     this.previoushash = previoushash;
     this.data         = data;
     this.nonce        = 0;
     hash = Bloock.CalculateHash(this);
 }
Exemple #2
0
        public void mineBlock(int diffifulty)
        {
            nonce = 0;
            int num = 0;

            while (!hash.Substring(0, diffifulty).Equals(num.ToString().PadLeft(diffifulty, '0')))
            {
                nonce++;
                hash = Bloock.CalculateHash(this);
            }
        }