aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-02-19 14:33:22 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:57 +0800
commitbfac0fd1c812592667b30184745becceb5ce1363 (patch)
treec6f1b719b9ec2c2427f78087c885c95cad6808bb /core/vm
parentd03cc83dbd327d984ade86b8d52542ef0d5c636d (diff)
downloaddexon-bfac0fd1c812592667b30184745becceb5ce1363.tar
dexon-bfac0fd1c812592667b30184745becceb5ce1363.tar.gz
dexon-bfac0fd1c812592667b30184745becceb5ce1363.tar.bz2
dexon-bfac0fd1c812592667b30184745becceb5ce1363.tar.lz
dexon-bfac0fd1c812592667b30184745becceb5ce1363.tar.xz
dexon-bfac0fd1c812592667b30184745becceb5ce1363.tar.zst
dexon-bfac0fd1c812592667b30184745becceb5ce1363.zip
core/vm: fix getConfigState (#203)
Diffstat (limited to 'core/vm')
-rw-r--r--core/vm/oracle_contracts.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go
index b1a56606b..e060312e5 100644
--- a/core/vm/oracle_contracts.go
+++ b/core/vm/oracle_contracts.go
@@ -1158,17 +1158,16 @@ func (s *GovernanceStateHelper) emitDKGReset(round *big.Int, blockHeight *big.In
func getConfigState(evm *EVM, round *big.Int) (*GovernanceStateHelper, error) {
configRound := big.NewInt(0)
- if round.Uint64() >= core.ConfigRoundShift {
- configRound = new(big.Int).Sub(round, big.NewInt(int64(core.ConfigRoundShift-1)))
+ if round.Uint64() > core.ConfigRoundShift {
+ configRound = new(big.Int).Sub(round, big.NewInt(int64(core.ConfigRoundShift)))
}
gs := &GovernanceStateHelper{evm.StateDB}
height := gs.RoundHeight(configRound).Uint64()
- if round.Uint64() >= core.ConfigRoundShift {
+ if round.Uint64() > core.ConfigRoundShift {
if height == 0 {
return nil, errExecutionReverted
}
- height--
}
statedb, err := evm.StateAtNumber(height)
return &GovernanceStateHelper{statedb}, err