From 9919263fe225d6bbd0183fba578a84ecbac8aae6 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Wed, 14 Nov 2018 10:57:53 +0800 Subject: 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 --- dex/governance.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'dex/governance.go') 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) -- cgit v1.2.3