Created
January 2, 2018 00:21
-
-
Save psycalc/9d4ebd5a460d79959341a899bed21f1a to your computer and use it in GitHub Desktop.
What is Mining Baby don't heart me no more....))))
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do { //just repetance until condition Not (!) will be true | |
//just object of class with field Nonce this is integer type can be 1..2 ..3 -1.. -3.. -5.. -1000 ... 100.. 999 and so on | |
block.Nonce++; //Mining by incremention | |
block.Hash = BlockChainLibrary.Crypto.Sha256.CalcHash(block.ToHashString()); | |
//method just return concatenated string Index+PreviousHash+Timestapm+Data+Nonce $"{Index}{PrevHash}{Timestamp}{Data}{Nonce}"; | |
} while (!BlockChainLibrary.Crypto.Sha256.IsValidHash(block.Hash)); | |
Blocks.Add(block); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment