Last active
August 29, 2015 14:10
-
-
Save GeertJohan/46c30b7d8124476ef100 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
type block struct { | |
height int64 | |
time time.Time | |
diff *big.Int | |
} |
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
type chain struct { | |
ladder []*block | |
} |
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
// DiffAlgo is the interface through which difficulty algorithms for the diffsim are implemented | |
type DiffAlgo interface { | |
// Name must return the name for the interface | |
Name() string | |
// Calculate gives the diff algo the chain on which to calculate the new difficulty | |
// The returned difficulty (*bit.Int) indicates the amount of work that must be done before a valid block hash is hit. | |
Calculate(c *chain) *big.Int | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment