aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-03-20 18:45:00 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:58 +0800
commitf247ebfcdb76160006f0124ff881e1e2a36e547e (patch)
tree706fa4ec53fa78ba80d06cb5de7b9b07b6bdb509
parent76de745eba01666d4407ded2e26d3c453996a8c3 (diff)
downloaddexon-f247ebfcdb76160006f0124ff881e1e2a36e547e.tar.gz
dexon-f247ebfcdb76160006f0124ff881e1e2a36e547e.tar.zst
dexon-f247ebfcdb76160006f0124ff881e1e2a36e547e.zip
core: vm: pay fine to governance owner and trigger set size recalculation (#288)
-rw-r--r--core/vm/oracle_contracts.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go
index cd11dc051..b9525e00b 100644
--- a/core/vm/oracle_contracts.go
+++ b/core/vm/oracle_contracts.go
@@ -1768,10 +1768,14 @@ func (g *GovernanceContract) payFine(nodeAddr common.Address) ([]byte, error) {
node.Fined = new(big.Int).Sub(node.Fined, g.contract.Value())
g.state.UpdateNode(nodeOffset, node)
- // TODO: paid fine should be added to award pool.
+ // Pay the fine to governance owner.
+ g.evm.StateDB.AddBalance(g.state.Owner(), g.contract.Value())
g.state.emitFinePaid(nodeAddr, g.contract.Value())
+ g.state.CalNotarySetSize()
+ g.state.CalDKGSetSize()
+
return g.useGas(GovernanceActionGasCost)
}