diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-02-27 10:41:01 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:57 +0800 |
commit | e83bcc1097d49b46b79131e546f1270b9192cc05 (patch) | |
tree | a1af659afd80e3744177637cc06b2f0662a0ced8 /core/governance.go | |
parent | 22b38ce74c3da40b7b7f24ada0abdf8d5ba03c64 (diff) | |
download | dexon-e83bcc1097d49b46b79131e546f1270b9192cc05.tar dexon-e83bcc1097d49b46b79131e546f1270b9192cc05.tar.gz dexon-e83bcc1097d49b46b79131e546f1270b9192cc05.tar.bz2 dexon-e83bcc1097d49b46b79131e546f1270b9192cc05.tar.lz dexon-e83bcc1097d49b46b79131e546f1270b9192cc05.tar.xz dexon-e83bcc1097d49b46b79131e546f1270b9192cc05.tar.zst dexon-e83bcc1097d49b46b79131e546f1270b9192cc05.zip |
core: sync to latest core (#214)
* vendor: sync to latest core
* fix for single chain
Diffstat (limited to 'core/governance.go')
-rw-r--r-- | core/governance.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/core/governance.go b/core/governance.go index 9929867c9..03f53ae6b 100644 --- a/core/governance.go +++ b/core/governance.go @@ -91,12 +91,11 @@ func (g *Governance) Configuration(round uint64) *coreTypes.Config { configHelper := g.GetGovStateHelperAtRound(round) c := configHelper.Configuration() return &coreTypes.Config{ - LambdaBA: time.Duration(c.LambdaBA) * time.Millisecond, - LambdaDKG: time.Duration(c.LambdaDKG) * time.Millisecond, - NotarySetSize: c.NotarySetSize, - DKGSetSize: c.DKGSetSize, - // TODO(jimmyhu): remove MinBlockInterval after coreTypes.Config update. - RoundInterval: time.Duration(c.RoundLength) * time.Duration(c.MinBlockInterval) * time.Millisecond, + LambdaBA: time.Duration(c.LambdaBA) * time.Millisecond, + LambdaDKG: time.Duration(c.LambdaDKG) * time.Millisecond, + NotarySetSize: c.NotarySetSize, + DKGSetSize: c.DKGSetSize, + RoundLength: c.RoundLength, MinBlockInterval: time.Duration(c.MinBlockInterval) * time.Millisecond, } } @@ -138,3 +137,7 @@ func (g *Governance) IsDKGFinal(round uint64) bool { func (g *Governance) MinGasPrice(round uint64) *big.Int { return g.GetGovStateHelperAtRound(round).MinGasPrice() } + +func (g *Governance) DKGResetCount(round uint64) uint64 { + return g.GetHeadHelper().DKGResetCount(big.NewInt(int64(round))).Uint64() +} |