Reset readCache upon commit
This commit is contained in:
parent
623ef17a84
commit
1c50204470
|
@ -128,8 +128,9 @@ func (app *Basecoin) Query(query []byte) (res tmsp.Result) {
|
||||||
|
|
||||||
// TMSP::Commit
|
// TMSP::Commit
|
||||||
func (app *Basecoin) Commit() (res tmsp.Result) {
|
func (app *Basecoin) Commit() (res tmsp.Result) {
|
||||||
// Commit eyes.
|
|
||||||
res = app.eyesCli.CommitSync()
|
// Commit state
|
||||||
|
res = app.state.Commit()
|
||||||
|
|
||||||
// Wrap the committed state in cache for CheckTx
|
// Wrap the committed state in cache for CheckTx
|
||||||
app.cacheState = app.state.CacheWrap()
|
app.cacheState = app.state.CacheWrap()
|
||||||
|
|
|
@ -4,6 +4,8 @@ import (
|
||||||
"github.com/tendermint/basecoin/types"
|
"github.com/tendermint/basecoin/types"
|
||||||
. "github.com/tendermint/go-common"
|
. "github.com/tendermint/go-common"
|
||||||
"github.com/tendermint/go-wire"
|
"github.com/tendermint/go-wire"
|
||||||
|
eyes "github.com/tendermint/merkleeyes/client"
|
||||||
|
tmsp "github.com/tendermint/tmsp/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CONTRACT: State should be quick to copy.
|
// CONTRACT: State should be quick to copy.
|
||||||
|
@ -75,6 +77,11 @@ func (s *State) CacheSync() {
|
||||||
s.writeCache.Sync()
|
s.writeCache.Sync()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *State) Commit() tmsp.Result {
|
||||||
|
s.readCache = make(map[string][]byte)
|
||||||
|
return s.store.(*eyes.Client).CommitSync()
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
|
|
||||||
func AccountKey(addr []byte) []byte {
|
func AccountKey(addr []byte) []byte {
|
||||||
|
|
Loading…
Reference in New Issue