Merge PR #4997: Fix CacheMultiStoreWithVersion (inter-block cache)
This commit is contained in:
@@ -321,6 +321,14 @@ func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStor
|
||||
for key, store := range rs.stores {
|
||||
switch store.GetStoreType() {
|
||||
case types.StoreTypeIAVL:
|
||||
// If the store is wrapped with an inter-block cache, we must first unwrap
|
||||
// it to get the underlying IAVL store.
|
||||
if rs.interBlockCache != nil {
|
||||
if ckvs := rs.interBlockCache.Unwrap(key); ckvs != nil {
|
||||
store = ckvs
|
||||
}
|
||||
}
|
||||
|
||||
// Attempt to lazy-load an already saved IAVL store version. If the
|
||||
// version does not exist or is pruned, an error should be returned.
|
||||
iavlStore, err := store.(*iavl.Store).GetImmutable(version)
|
||||
|
||||
Reference in New Issue
Block a user