2863ed67fd
I made an suboptimal (aka stupid) decision to stop and wait for peers one by one which makes shutdown very slow - O(n). This PR decouples sending stop signal from waiting a thread to exit. On top of it in Peers we first send stop signal to all peers and only after that start waiting for them to exit. It gives us a constant time of shutdown in most of the cases.