Clearing roots after thread has joined to avoid a use-after-free situation.

Boost multi_index iterators remain valid on insertion but not after erasure.
This commit is contained in:
clemahieu 2018-11-08 14:13:27 -06:00
commit c8245e83d9

View file

@ -3007,13 +3007,13 @@ void rai::active_transactions::stop ()
condition.wait (lock);
}
stopped = true;
roots.clear ();
condition.notify_all ();
}
if (thread.joinable ())
{
thread.join ();
}
roots.clear ();
}
bool rai::active_transactions::start (std::shared_ptr<rai::block> block_a, std::function<void(std::shared_ptr<rai::block>)> const & confirmation_action_a)