aboutsummaryrefslogtreecommitdiffstats
path: root/dex
diff options
context:
space:
mode:
authorWei-Ning Huang <aitjcize@gmail.com>2018-11-14 10:57:53 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:53 +0800
commit3a84568a63f64423683a1dbb9f46cee886a39270 (patch)
tree070d3478a6f2031b447148ee1d51a952565c02ab /dex
parentc1138b576524413f8d5755f77aaebd759d6317fc (diff)
downloaddexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.gz
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.bz2
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.lz
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.xz
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.tar.zst
dexon-3a84568a63f64423683a1dbb9f46cee886a39270.zip
core: validate DKG set with correct nodeset in round-2 (#19)
* vendor: sync consensus core * core: validate DKG set with correct nodeset in round-2
Diffstat (limited to 'dex')
-rw-r--r--dex/governance.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/dex/governance.go b/dex/governance.go
index 92a8789b3..0251d2afd 100644
--- a/dex/governance.go
+++ b/dex/governance.go
@@ -24,8 +24,6 @@ import (
"github.com/dexon-foundation/dexon/rpc"
)
-const configActivationOffset = 2
-
type DexconGovernance struct {
b *DexAPIBackend
chainConfig *params.ChainConfig
@@ -68,10 +66,10 @@ func (d *DexconGovernance) getGovState() *vm.GovernanceStateHelper {
}
func (d *DexconGovernance) getGovStateAtRound(round uint64) *vm.GovernanceStateHelper {
- if round < configActivationOffset {
+ if round < dexCore.ConfigRoundShift {
round = 0
} else {
- round -= configActivationOffset
+ round -= dexCore.ConfigRoundShift
}
ctx := context.Background()
blockHeight, err := d.getRoundHeight(ctx, round)