libcoin/libcoin — pull request #75 by domob1812 (2014-10-29 08:47:06+00:00)
Title: Fix the peer manager's median calculation.

The previous version was producing random crashes due to race conditions between inserting new values and reading _sorted. The implementation is now changed to calculate the median on changes and cache the value. While this hasn't introduced any locking, the reading routine `median()` can now no longer see an inconsistent state. If at the same time an update happens, it can only either see the old or the new value, which is both fine.

If locking is still considered better practice, I can, of course, add locks.