diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/vm/governance.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/vm/governance.go b/core/vm/governance.go index c75102f79..652d86357 100644 --- a/core/vm/governance.go +++ b/core/vm/governance.go @@ -904,6 +904,13 @@ func (g *GovernanceContract) proposeCRS(round *big.Int, signedCRS []byte) ([]byt } func (g *GovernanceContract) addDKGMasterPublicKey(round *big.Int, pk []byte) ([]byte, error) { + caller := g.contract.Caller() + offset := g.state.offset(caller) + // Can not add dkg mpk if not staked. + if offset.Cmp(big.NewInt(0)) < 0 { + return nil, errExecutionReverted + } + var dkgMasterPK types.DKGMasterPublicKey if err := rlp.DecodeBytes(pk, &dkgMasterPK); err != nil { g.penalize() |