Skip to content

Instantly share code, notes, and snippets.

@cx0der
Created August 12, 2018 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cx0der/2cdc78135b8caee6c02350b2dd031225 to your computer and use it in GitHub Desktop.
Save cx0der/2cdc78135b8caee6c02350b2dd031225 to your computer and use it in GitHub Desktop.
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