diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-02-19 14:33:22 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:22 +0800 |
commit | ba2dff731e1c430809f3df1e7b4e945c5eb76a56 (patch) | |
tree | 82b9748fb688c2b41953ab753fd75db5587a62b2 | |
parent | 0e82ab2363f2f49884d29709268b1979fc24e919 (diff) | |
download | go-tangerine-ba2dff731e1c430809f3df1e7b4e945c5eb76a56.tar go-tangerine-ba2dff731e1c430809f3df1e7b4e945c5eb76a56.tar.gz go-tangerine-ba2dff731e1c430809f3df1e7b4e945c5eb76a56.tar.bz2 go-tangerine-ba2dff731e1c430809f3df1e7b4e945c5eb76a56.tar.lz go-tangerine-ba2dff731e1c430809f3df1e7b4e945c5eb76a56.tar.xz go-tangerine-ba2dff731e1c430809f3df1e7b4e945c5eb76a56.tar.zst go-tangerine-ba2dff731e1c430809f3df1e7b4e945c5eb76a56.zip |
core/vm: fix getConfigState (#203)
-rw-r--r-- | core/vm/oracle_contracts.go | 7 |
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 |