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); }
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); } }