less stake endblock processing

This commit is contained in:
rigelrozanski 2018-07-20 11:35:13 -04:00
parent accce5c7d8
commit 9e5a78fc7a
3 changed files with 6 additions and 7 deletions

View File

@ -143,8 +143,8 @@ func (app *GaiaApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) ab
// application updates every end block
// nolint: unparam
func (app *GaiaApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
validatorUpdates := stake.EndBlocker(ctx, app.stakeKeeper)
validatorUpdates := stake.EndBlocker(ctx, app.stakeKeeper)
tags, _ := gov.EndBlocker(ctx, app.govKeeper)
return abci.ResponseEndBlock{

View File

@ -11,6 +11,7 @@ import (
// slashing begin block functionality
func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, sk Keeper) (tags sdk.Tags) {
// Tag the height
heightBytes := make([]byte, 8)
binary.LittleEndian.PutUint64(heightBytes, uint64(req.Header.Height))

View File

@ -34,19 +34,17 @@ func NewHandler(k keeper.Keeper) sdk.Handler {
// Called every block, process inflation, update validator set
func EndBlocker(ctx sdk.Context, k keeper.Keeper) (ValidatorUpdates []abci.Validator) {
pool := k.GetPool(ctx)
params := k.GetParams(ctx)
// Process types.Validator Provisions
// Process provision inflation
blockTime := ctx.BlockHeader().Time
if blockTime-pool.InflationLastTime >= 3600 {
params := k.GetParams(ctx)
pool := k.GetPool(ctx)
pool.InflationLastTime = blockTime
pool = pool.ProcessProvisions(params)
k.SetPool(ctx, pool)
}
// save the params
k.SetPool(ctx, pool)
// reset the intra-transaction counter
k.SetIntraTxCounter(ctx, 0)