Skip to content

Instantly share code, notes, and snippets.

@hearinleaf
Forked from aunyks/snakecoin-new-block.py
Created July 19, 2017 03:02
Show Gist options
  • Save hearinleaf/51669a5c86a5ff7ab8d4f70144b93b8c to your computer and use it in GitHub Desktop.
Save hearinleaf/51669a5c86a5ff7ab8d4f70144b93b8c to your computer and use it in GitHub Desktop.
def next_block(last_block):
this_index = last_block.index + 1
this_timestamp = date.datetime.now()
this_data = "Hey! I'm block " + str(this_index)
this_hash = last_block.hash
return Block(this_index, this_timestamp, this_data, this_hash)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment