cachecontext comments and changelog update

This commit is contained in:
rigelrozanski
2018-04-10 15:44:49 -04:00
parent 1c8094c6bd
commit bdc7fe56ba
2 changed files with 8 additions and 3 deletions
+4 -3
View File
@@ -22,7 +22,6 @@ next decorator or handler. For example,
...
}
*/
type Context struct {
context.Context
pst *thePast
@@ -172,9 +171,11 @@ func (c Context) WithTxBytes(txBytes []byte) Context {
return c.withValue(contextKeyTxBytes, txBytes)
}
func (c Context) CacheContext() (Context, func()) {
// Cache the multistore and return a new cached context. The cached context is
// written to the context when writeCache is called.
func (c Context) CacheContext() (cc Context, writeCache func()) {
cms := c.multiStore().CacheMultiStore()
cc := c.WithMultiStore(cms)
cc = c.WithMultiStore(cms)
return cc, cms.Write
}