Skip to content

Instantly share code, notes, and snippets.

Created August 12, 2018 14:37
What would you like to do?
Adding a new block
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