Skip to content

Commit

Permalink
Apply code review
Browse files Browse the repository at this point in the history
  • Loading branch information
longfin committed Sep 23, 2020
1 parent 97504af commit 178ada1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Libplanet/Store/BlockSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,15 @@ private Block<T> GetBlock(HashDigest<SHA256> key)
{
if (_cache.TryGetValue(key, out Block<T> cached))
{
return cached;
if (Store.ContainsBlock(key))
{
return cached;
}
else
{
// The cached block had been deleted on Store...
_cache.Remove(key);
}
}

Block<T> fetched = Store.GetBlock<T>(key);
Expand Down

0 comments on commit 178ada1

Please sign in to comment.