Skip to content

Instantly share code, notes, and snippets.

@murych
Forked from aunyks/snakecoin-new-block.py
Created July 18, 2017 11:02
Show Gist options
  • Save murych/022491e0cd691c76831e414a284ab961 to your computer and use it in GitHub Desktop.
Save murych/022491e0cd691c76831e414a284ab961 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