Created
July 2, 2018 06:11
-
-
Save nosequeldeebee/f414874c9eba1f8475f1973e034cd034 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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