diff options
author | Wei-Ning Huang <aitjcize@gmail.com> | 2018-11-14 10:57:53 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 9919263fe225d6bbd0183fba578a84ecbac8aae6 (patch) | |
tree | eba3fb16d35cb9db8769619ba5984fc4a9bfbfa6 /dex | |
parent | 9d1efe14607683825c69cce8f690e0f327c6a7b0 (diff) | |
download | dexon-9919263fe225d6bbd0183fba578a84ecbac8aae6.tar.gz dexon-9919263fe225d6bbd0183fba578a84ecbac8aae6.tar.zst dexon-9919263fe225d6bbd0183fba578a84ecbac8aae6.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.go | 6 |
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) |