Properly deleting items from unchecked_cache.

This commit is contained in:
clemahieu 2017-08-04 14:20:36 -05:00
commit e8cc818ae5

View file

@ -2364,7 +2364,7 @@ std::vector <std::shared_ptr <rai::block>> rai::block_store::unchecked_get (MDB_
void rai::block_store::unchecked_del (MDB_txn * transaction_a, rai::block_hash const & hash_a, rai::block const & block_a)
{
for (auto i (unchecked_cache.begin ()), n (unchecked_cache.end ()); i != n && i->first == hash_a;)
for (auto i (unchecked_cache.find (hash_a)), n (unchecked_cache.end ()); i != n && i->first == hash_a;)
{
if (*i->second == block_a)
{