move new to begin block

This commit is contained in:
William Banfield
2022-08-18 15:19:22 -04:00
parent 8bcfc626ca
commit 78a3a3dd56
2 changed files with 7 additions and 2 deletions

View File

@@ -137,7 +137,6 @@ func (app *Application) Commit() types.ResponseCommit {
app.state.Height++
// empty out the set of transactions to remove via rechecktx
app.txToRemove = map[string]struct{}{}
saveState(app.state)
resp := types.ResponseCommit{Data: appHash}
@@ -183,6 +182,11 @@ func (app *Application) Query(reqQuery types.RequestQuery) (resQuery types.Respo
return resQuery
}
func (app *Application) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock {
app.txToRemove = map[string]struct{}{}
return types.ResponseBeginBlock{}
}
func (app *Application) ProcessProposal(
req types.RequestProcessProposal) types.ResponseProcessProposal {
for _, tx := range req.Txs {

View File

@@ -124,6 +124,7 @@ func (app *PersistentKVStoreApplication) InitChain(req types.RequestInitChain) t
// Track the block hash and header information
func (app *PersistentKVStoreApplication) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock {
app.app.txToRemove = map[string]struct{}{}
// reset valset changes
app.ValUpdates = make([]types.ValidatorUpdate, 0)
@@ -145,7 +146,7 @@ func (app *PersistentKVStoreApplication) BeginBlock(req types.RequestBeginBlock)
}
}
return types.ResponseBeginBlock{}
return app.BeginBlock(req)
}
// Update the validator set