diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-10-22 19:53:24 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:50 +0800 |
commit | 77882898913a3e2ed0a0ce59090a4e62da39c58f (patch) | |
tree | ad50f11792dde7faa8f138c452879eb0703196fb /core/vm | |
parent | defdcafc514226b73050467ac42c787ef3f7cfea (diff) | |
download | go-tangerine-77882898913a3e2ed0a0ce59090a4e62da39c58f.tar go-tangerine-77882898913a3e2ed0a0ce59090a4e62da39c58f.tar.gz go-tangerine-77882898913a3e2ed0a0ce59090a4e62da39c58f.tar.bz2 go-tangerine-77882898913a3e2ed0a0ce59090a4e62da39c58f.tar.lz go-tangerine-77882898913a3e2ed0a0ce59090a4e62da39c58f.tar.xz go-tangerine-77882898913a3e2ed0a0ce59090a4e62da39c58f.tar.zst go-tangerine-77882898913a3e2ed0a0ce59090a4e62da39c58f.zip |
dex: fix round switching and initialize dMoment correctly
Diffstat (limited to 'core/vm')
-rw-r--r-- | core/vm/governance.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/vm/governance.go b/core/vm/governance.go index 5e6cc0b4d..d30987b11 100644 --- a/core/vm/governance.go +++ b/core/vm/governance.go @@ -1413,7 +1413,8 @@ func (g *GovernanceContract) addDKGComplaint(round *big.Int, comp []byte) ([]byt } func (g *GovernanceContract) addDKGMasterPublicKey(round *big.Int, mpk []byte) ([]byte, error) { - if round.Cmp(g.state.Round()) != 0 { + // Can only add DKG master public key of current and next round. + if round.Cmp(new(big.Int).Add(g.state.Round(), big.NewInt(1))) > 0 { g.penalize() return nil, errExecutionReverted } |