diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-10-18 15:38:44 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-10-18 15:44:57 +0200 |
commit | cdfb7755a6af2e95e8598ca8e8d6896c745bcd72 (patch) | |
tree | fce0cfa5a1d83ef5f9c6f84a6f0875bf1903323f /src/net.h | |
parent | 0306978394dbf96d07e61cde5fb7240d29706361 (diff) | |
parent | 5eaaa83ac1f5eb525f93e2808fafd73f5ed97013 (diff) |
Merge #8914: Kill insecure_random and associated global state
5eaaa83 Kill insecure_random and associated global state (Wladimir J. van der Laan)
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -735,14 +735,14 @@ public: addrKnown.insert(_addr.GetKey()); } - void PushAddress(const CAddress& _addr) + void PushAddress(const CAddress& _addr, FastRandomContext &insecure_rand) { // Known checking here is only to save space from duplicates. // SendMessages will filter it again for knowns that were added // after addresses were pushed. if (_addr.IsValid() && !addrKnown.contains(_addr.GetKey())) { if (vAddrToSend.size() >= MAX_ADDR_TO_SEND) { - vAddrToSend[insecure_rand() % vAddrToSend.size()] = _addr; + vAddrToSend[insecure_rand.rand32() % vAddrToSend.size()] = _addr; } else { vAddrToSend.push_back(_addr); } |