Created
August 12, 2018 14:37
-
-
Save cx0der/2cdc78135b8caee6c02350b2dd031225 to your computer and use it in GitHub Desktop.
Adding a new block
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
def add_block (data): | |
prev_block = get_last_block() | |
timestamp = time.time() | |
new_block = mine_block(prev_block.index + 1, prev_block.hash, timestamp, data) | |
return new_block |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment