Right now, the message handling loop iterates the list of nodes always in the same order: the order they were connected in (see the vNodes
vector). For some parts of the net processing logic, this order matters. Transaction requests are assigned explicitly to peers since #19988, but many other parts of processing work on a “first-served-by-loop-first” basis, such as block downloading. If peers can predict this ordering, it may be exploited to cause delays.
As there isn’t anything particularly optimal about the current ordering, just make it unpredictable by randomizing.
Reported by Crypt-iQ.