Skip to content

Instantly share code, notes, and snippets.

@fernandoporazzi
Last active January 18, 2019 13:28
Show Gist options
  • Save fernandoporazzi/f378fdd02412aa0f9ec5d6e994f335d0 to your computer and use it in GitHub Desktop.
Save fernandoporazzi/f378fdd02412aa0f9ec5d6e994f335d0 to your computer and use it in GitHub Desktop.
package block
import (
"time"
)
type Block struct {
Index int
PreviousHash string
Data string
Timestamp time.Time
Difficulty int
Hash string
Nonce int
}
func CreateBlock() Block {
var block Block
block.Timestamp = time.Now()
block.Nonce = 0
return block
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment