Skip to content

Instantly share code, notes, and snippets.

@cx0der

cx0der/add_block.py

Created Aug 12, 2018
Embed
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
You can’t perform that action at this time.