aboutsummaryrefslogtreecommitdiffstats
path: root/core/utils.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-11-05 13:29:15 +0800
committerGitHub <noreply@github.com>2018-11-05 13:29:15 +0800
commitc4541185c1d2502dffe09de1af52594f6fae16a6 (patch)
tree7ab3afa6cb30f2bd7ffdf5158da2e50384dab136 /core/utils.go
parent62a00d3cf89330073df381caa7d913deeb01822d (diff)
downloaddexon-consensus-c4541185c1d2502dffe09de1af52594f6fae16a6.tar
dexon-consensus-c4541185c1d2502dffe09de1af52594f6fae16a6.tar.gz
dexon-consensus-c4541185c1d2502dffe09de1af52594f6fae16a6.tar.bz2
dexon-consensus-c4541185c1d2502dffe09de1af52594f6fae16a6.tar.lz
dexon-consensus-c4541185c1d2502dffe09de1af52594f6fae16a6.tar.xz
dexon-consensus-c4541185c1d2502dffe09de1af52594f6fae16a6.tar.zst
dexon-consensus-c4541185c1d2502dffe09de1af52594f6fae16a6.zip
core: notify consensus height for genesis rounds (#296)
* Add notifyGenesisRounds * Log round for types.Vote and types.Block
Diffstat (limited to 'core/utils.go')
-rw-r--r--core/utils.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/utils.go b/core/utils.go
index 6b9ce63..9159be8 100644
--- a/core/utils.go
+++ b/core/utils.go
@@ -159,3 +159,14 @@ func DiffUint64(a, b uint64) uint64 {
}
return b - a
}
+
+// notifyGenesisRounds notifies governance to generate configs based on genesis
+// state.
+func notifyGenesisRounds(initBlock *types.Block, gov Governance) {
+ if initBlock.Position.Round != 0 || !initBlock.IsGenesis() {
+ return
+ }
+ for round := uint64(0); round < roundShift; round++ {
+ gov.NotifyRoundHeight(round, 0)
+ }
+}