forked from Qortal/qortal
- Removed synchronization from connectedPeers, and replaced it with an unmodifiableList. - Added additional immuatable caches: handshakedPeers and outboundHandshakedPeers This should greatly reduce the amount of time spent waiting around for access to the connectedPeers array, since it is now immediately accessible without needing to obtain a lock. It also removes calls to stream() which were consuming large amounts of CPU to constantly filter the connected peers down to a list of handshaked peers. Thanks to @catbref for these great suggestions.