Skip to content

Instantly share code, notes, and snippets.

@nosequeldeebee
Created July 2, 2018 06:11
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 nosequeldeebee/f414874c9eba1f8475f1973e034cd034 to your computer and use it in GitHub Desktop.
Save nosequeldeebee/f414874c9eba1f8475f1973e034cd034 to your computer and use it in GitHub Desktop.
// Block represents each 'item' in the blockchain
type Block struct {
Index int
Timestamp string
BPM int
Hash string
PrevHash string
Validator string
}
// Blockchain is a series of validated Blocks
var Blockchain []Block
var tempBlocks []Block
// candidateBlocks handles incoming blocks for validation
var candidateBlocks = make(chan Block)
// announcements broadcasts winning validator to all nodes
var announcements = make(chan string)
var mutex = &sync.Mutex{}
// validators keeps track of open validators and balances
var validators = make(map[string]int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment