mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Add a FastRandomContext::randrange and use it
This commit is contained in:
@@ -760,7 +760,7 @@ public:
|
||||
// after addresses were pushed.
|
||||
if (_addr.IsValid() && !addrKnown.contains(_addr.GetKey())) {
|
||||
if (vAddrToSend.size() >= MAX_ADDR_TO_SEND) {
|
||||
vAddrToSend[insecure_rand.rand32() % vAddrToSend.size()] = _addr;
|
||||
vAddrToSend[insecure_rand.randrange(vAddrToSend.size())] = _addr;
|
||||
} else {
|
||||
vAddrToSend.push_back(_addr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user