@@ -820,6 +820,7 @@ static void RelayAddress(const CAddress& addr, bool fReachable, CConnman& connma
820820 uint64_t hashAddr = addr.GetHash ();
821821 multimap<uint64_t , CNode*> mapMix;
822822 const CSipHasher hasher = connman.GetDeterministicRandomizer (RANDOMIZER_ID_ADDRESS_RELAY ).Write (hashAddr << 32 ).Write ((GetTime () + hashAddr) / (24 *60 *60 ));
823+ FastRandomContext insecure_rand;
823824
824825 auto sortfunc = [&mapMix, &hasher](CNode* pnode) {
825826 if (pnode->nVersion >= CADDR_TIME_VERSION ) {
@@ -828,9 +829,9 @@ static void RelayAddress(const CAddress& addr, bool fReachable, CConnman& connma
828829 }
829830 };
830831
831- auto pushfunc = [&addr, &mapMix, &nRelayNodes] {
832+ auto pushfunc = [&addr, &mapMix, &nRelayNodes, &insecure_rand ] {
832833 for (auto mi = mapMix.begin (); mi != mapMix.end () && nRelayNodes-- > 0 ; ++mi)
833- mi->second ->PushAddress (addr);
834+ mi->second ->PushAddress (addr, insecure_rand );
834835 };
835836
836837 connman.ForEachNodeThen (std::move (sortfunc), std::move (pushfunc));
@@ -1248,14 +1249,15 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
12481249 if (fListen && !IsInitialBlockDownload ())
12491250 {
12501251 CAddress addr = GetLocalAddress (&pfrom->addr , pfrom->GetLocalServices ());
1252+ FastRandomContext insecure_rand;
12511253 if (addr.IsRoutable ())
12521254 {
12531255 LogPrint (" net" , " ProcessMessages: advertising address %s\n " , addr.ToString ());
1254- pfrom->PushAddress (addr);
1256+ pfrom->PushAddress (addr, insecure_rand );
12551257 } else if (IsPeerAddrLocalGood (pfrom)) {
12561258 addr.SetIP (pfrom->addrLocal );
12571259 LogPrint (" net" , " ProcessMessages: advertising address %s\n " , addr.ToString ());
1258- pfrom->PushAddress (addr);
1260+ pfrom->PushAddress (addr, insecure_rand );
12591261 }
12601262 }
12611263
@@ -2022,8 +2024,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
20222024
20232025 pfrom->vAddrToSend .clear ();
20242026 vector<CAddress> vAddr = connman.GetAddresses ();
2027+ FastRandomContext insecure_rand;
20252028 BOOST_FOREACH (const CAddress &addr, vAddr)
2026- pfrom->PushAddress (addr);
2029+ pfrom->PushAddress (addr, insecure_rand );
20272030 }
20282031
20292032
@@ -2935,7 +2938,7 @@ bool SendMessages(CNode* pto, CConnman& connman, std::atomic<bool>& interruptMsg
29352938 // until scheduled broadcast, then move the broadcast to within MAX_FEEFILTER_CHANGE_DELAY.
29362939 else if (timeNow + MAX_FEEFILTER_CHANGE_DELAY * 1000000 < pto->nextSendTimeFeeFilter &&
29372940 (currentFilter < 3 * pto->lastSentFeeFilter / 4 || currentFilter > 4 * pto->lastSentFeeFilter / 3 )) {
2938- pto->nextSendTimeFeeFilter = timeNow + ( insecure_rand () % MAX_FEEFILTER_CHANGE_DELAY ) * 1000000 ;
2941+ pto->nextSendTimeFeeFilter = timeNow + GetRandInt ( MAX_FEEFILTER_CHANGE_DELAY ) * 1000000 ;
29392942 }
29402943 }
29412944 }
0 commit comments