diff options
-rw-r--r-- | core/vm/oracle_contracts.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go index d7c8ffae2..843b23d18 100644 --- a/core/vm/oracle_contracts.go +++ b/core/vm/oracle_contracts.go @@ -456,6 +456,9 @@ func (s *GovernanceState) UpdateNode(index *big.Int, n *nodeInfo) { // UnstakedAt. loc = new(big.Int).Add(elementBaseLoc, big.NewInt(9)) s.setStateBigInt(loc, n.UnstakedAt) + + // Update set size. + s.CalNotarySetSize() } func (s *GovernanceState) PopLastNode() { // Decrease length by 1. @@ -1051,6 +1054,7 @@ func (s *GovernanceState) UpdateConfigurationRaw(cfg *rawConfigStruct) { s.setStateBigInt(big.NewInt(minBlockIntervalLoc), cfg.MinBlockInterval) s.SetFineValues(cfg.FineValues) + // Calculate set size. s.CalNotarySetSize() } @@ -1609,8 +1613,6 @@ func (g *GovernanceContract) register( if value.Cmp(big.NewInt(0)) > 0 { g.state.IncTotalStaked(value) g.state.emitStaked(caller, value) - - g.state.CalNotarySetSize() } return g.useGas(GovernanceActionGasCost) } @@ -1639,8 +1641,6 @@ func (g *GovernanceContract) stake() ([]byte, error) { g.state.IncTotalStaked(value) g.state.emitStaked(caller, value) - g.state.CalNotarySetSize() - return g.useGas(GovernanceActionGasCost) } @@ -1675,8 +1675,6 @@ func (g *GovernanceContract) unstake(amount *big.Int) ([]byte, error) { g.state.DecTotalStaked(amount) g.state.emitUnstaked(caller, amount) - g.state.CalNotarySetSize() - return g.useGas(GovernanceActionGasCost) } @@ -1755,8 +1753,6 @@ func (g *GovernanceContract) payFine(nodeAddr common.Address) ([]byte, error) { g.state.emitFinePaid(nodeAddr, g.contract.Value()) - g.state.CalNotarySetSize() - return g.useGas(GovernanceActionGasCost) } |