/// <summary> /// Method to mine a blocks' hash /// </summary> /// <param name="difficulty"></param> public void MineBlock(int difficulty) { while (BlockHash.Substring(0, difficulty) != new string('0', difficulty)) { _shaSalt++; BlockHash = CalculateHash(); } betBlock.CalculateHash(); }
public void MineBlock(int difficulty) { while (BlockHash.Substring(0, difficulty) != new string('0', difficulty)) { _shaSalt++; BlockHash = CalculateHash(); Console.WriteLine("Currently mining: " + BlockHash); } Console.WriteLine("Block " + BlockHash + " have been mined!"); }