Created
January 29, 2018 05:19
-
-
Save nosequeldeebee/962b6150bd204c5c9ed83d8b58912256 to your computer and use it in GitHub Desktop.
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
func generateBlock(oldBlock Block, BPM int) (Block, error) { | |
var newBlock Block | |
t := time.Now() | |
newBlock.Index = oldBlock.Index + 1 | |
newBlock.Timestamp = t.String() | |
newBlock.BPM = BPM | |
newBlock.PrevHash = oldBlock.Hash | |
newBlock.Hash = calculateHash(newBlock) | |
return newBlock, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment