Skip to content

Commit 93f43f0

Browse files
committed
Merge #2278: [Refactor] Update RNG code from upstream
cecbf6c Use secure.h header for secure allocators (Fuzzbawls) d9f67da net: add ifaddrs.h include (fanquake) e906436 build: check if -lsocket is required with *ifaddrs (fanquake) 414f405 rand: only try and use freeifaddrs if available (fanquake) 3a039d6 build: avoid getifaddrs when unavailable (Cory Fields) 77bddd7 Use GetStrongRandBytes in gmp bignum initialization (Fuzzbawls) b70b26f Fix typo in comment in randomenv.cpp (Fuzzbawls) fec460c Put bounds on the number of CPUID leaves explored (Pieter Wuille) 41ab1ff Fix CPUID subleaf iteration (Pieter Wuille) 8a9bbb1 Move events_hasher into RNGState() (Pieter Wuille) 88c2ae5 random: mark RandAddPeriodic and SeedPeriodic as noexcept (fanquake) 81d382f doc: correct random.h docs after bitcoin#17270 (fanquake) f363ea9 Seed RNG with precision timestamps on receipt of net messages. (Matt Corallo) 7d6ddcb Run background seeding periodically instead of unpredictably (Pieter Wuille) 4679181 Add information gathered through getauxval() (Pieter Wuille) 88d97d0 Feed CPUID data into RNG (Pieter Wuille) 8f5b9c9 Use sysctl for seeding on MacOS/BSD (Pieter Wuille) 67de246 Gather additional entropy from the environment (Pieter Wuille) 6142e1f Seed randomness with process id / thread id / various clocks (Pieter Wuille) 7bde8b7 [MOVEONLY] Move cpuid code from random to compat/cpuid (Fuzzbawls) 52b5336 [MOVEONLY] Move perfmon data gathering to new randomenv module (Pieter Wuille) 27cf995 doc: minor corrections in random.cpp (fanquake) fccd2b8 doc: correct function name in ReportHardwareRand() (fanquake) 909473e Fix FreeBSD build by including utilstrencodings.h (Fuzzbawls) 630931f break circular dependency: random/sync -> util -> random/sync (Fuzzbawls) 5eed08c random: remove call to RAND_screen() (Windows only) (fanquake) ada9868 gui: remove OpenSSL PRNG seeding (Windows, Qt only) (fanquake) 22a7121 Fix non-deterministic coverage of test DoS_mapOrphans (Fuzzbawls) 79e7fd3 Add ChaCha20 bench (Jonas Schnelli) 6966aa9 Add ChaCha20 encryption option (XOR) (Jonas Schnelli) 28c9cdb tests: Add script checking for deterministic line coverage (practicalswift) c82e359 test: Make bloom tests deterministic (MarcoFalke) 7b33223 Document strenghtening (Pieter Wuille) 0190dec Add hash strengthening to the RNG (Pieter Wuille) 67e336d Use RdSeed when available, and reduce RdRand load (Pieter Wuille) 4ffda1f Document RNG design in random.h (Pieter Wuille) 2b6381e Use secure allocator for RNG state (Pieter Wuille) 080deb3 Encapsulate RNGState better (Pieter Wuille) 787d72f DRY: Implement GetRand using FastRandomContext::randrange (Pieter Wuille) 5bc2583 Sprinkle some sweet noexcepts over the RNG code (Pieter Wuille) 774899f Remove hwrand_initialized. (Pieter Wuille) 698d133 Switch all RNG code to the built-in PRNG. (Pieter Wuille) 038a45a Integrate util/system's CInit into RNGState (Fuzzbawls) 5f20e62 Abstract out seeding/extracting entropy into RNGState::MixExtract (Pieter Wuille) 298f97c Add thread safety annotations to RNG state (Pieter Wuille) 2326535 Rename some hardware RNG related functions (Pieter Wuille) d76ee83 Automatically initialize RNG on first use. (Pieter Wuille) 1a5dbc5 Don't log RandAddSeedPerfmon details (Pieter Wuille) 32e6c42 Simplify testing RNG code (Fuzzbawls) 972effa Make unit tests use the insecure_rand_ctx exclusively (Fuzzbawls) af52bf5 Use a FastRandomContext in LimitOrphanTxSize (Fuzzbawls) 746d466 Introduce a Shuffle for FastRandomContext and use it in wallet (Fuzzbawls) 1cdf124 Use a local FastRandomContext in a few more places in net (Fuzzbawls) e862564 Make addrman use its local RNG exclusively (Fuzzbawls) 94b2ead Make FastRandomContext support standard C++11 RNG interface (Pieter Wuille) Pull request description: This is a collection of upstream PRs that have been backported to bring our RNG (`src/random`) code more up-to-date. The following upstream PRs have been included here: - bitcoin#12742 - bitcoin#14624 - some of this had already been merged previously - bitcoin#14955 - bitcoin#15250 - bitcoin#15224 - bitcoin#15324 - bitcoin#15296 - bitcoin#15512 - bitcoin#16878 - bitcoin#17151 - bitcoin#17191 - bitcoin#13236 - bitcoin#13314 - bitcoin#17169 - bitcoin#17270 - omitted last commit as our testing framework doesn't support it currently - omitted bitcoin@64e1e02, to be pulled in after our time utility is updated in a separate PR - bitcoin#17573 - bitcoin#17507 - bitcoin#17670 - bitcoin#17527 - bitcoin#14127 - bitcoin#21486 ACKs for top commit: furszy: ACK cecbf6c with a minor nit that can be easily tackled later. random-zebra: rebase utACK cecbf6c and merging... Tree-SHA512: 3463b693cc9bddc1ec15228d264a794f5c2f159073fafa2ccf6e2563abfeb4369e49505f97ca84f2478ca792bd07b66d2cd83c58044d6a0cae6af42d22f5784b
2 parents b776825 + cecbf6c commit 93f43f0

34 files changed

+1695
-362
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ set(UTIL_SOURCES
431431
./src/fs.cpp
432432
./src/logging.cpp
433433
./src/random.cpp
434+
./src/randomenv.cpp
434435
./src/rpc/protocol.cpp
435436
./src/sync.cpp
436437
./src/threadinterrupt.cpp

build-aux/m4/l_socket.m4

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Illumos/SmartOS requires linking with -lsocket if
2+
# using getifaddrs & freeifaddrs
3+
4+
m4_define([_CHECK_SOCKET_testbody], [[
5+
#include <sys/types.h>
6+
#include <ifaddrs.h>
7+
8+
int main() {
9+
struct ifaddrs *ifaddr;
10+
getifaddrs(&ifaddr);
11+
freeifaddrs(ifaddr);
12+
}
13+
]])
14+
15+
AC_DEFUN([CHECK_SOCKET], [
16+
17+
AC_LANG_PUSH(C++)
18+
19+
AC_MSG_CHECKING([whether ifaddrs funcs can be used without link library])
20+
21+
AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_SOCKET_testbody])],[
22+
AC_MSG_RESULT([yes])
23+
],[
24+
AC_MSG_RESULT([no])
25+
LIBS="$LIBS -lsocket"
26+
AC_MSG_CHECKING([whether getifaddrs needs -lsocket])
27+
AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_SOCKET_testbody])],[
28+
AC_MSG_RESULT([yes])
29+
],[
30+
AC_MSG_RESULT([no])
31+
AC_MSG_FAILURE([cannot figure out how to use getifaddrs])
32+
])
33+
])
34+
35+
AC_LANG_POP
36+
])

configure.ac

+17-1
Original file line numberDiff line numberDiff line change
@@ -749,8 +749,12 @@ if test x$TARGET_OS = xdarwin; then
749749
AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"])
750750
fi
751751

752-
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h])
752+
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h])
753753

754+
AC_CHECK_DECLS([getifaddrs, freeifaddrs],[CHECK_SOCKET],,
755+
[#include <sys/types.h>
756+
#include <ifaddrs.h>]
757+
)
754758
AC_CHECK_DECLS([strnlen])
755759

756760
# Check for daemon(3), unrelated to --with-daemon (although used by it)
@@ -888,6 +892,18 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
888892
[ AC_MSG_RESULT(no)]
889893
)
890894

895+
AC_MSG_CHECKING(for sysctl)
896+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
897+
#include <sys/sysctl.h>]],
898+
[[ static const int name[2] = {CTL_KERN, KERN_VERSION};
899+
#ifdef __linux__
900+
#error "Don't use sysctl on Linux, it's deprecated even when it works"
901+
#endif
902+
sysctl(name, 2, nullptr, nullptr, nullptr, 0); ]])],
903+
[ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL, 1,[Define this symbol if the BSD sysctl() is available]) ],
904+
[ AC_MSG_RESULT(no)]
905+
)
906+
891907
AC_MSG_CHECKING(for sysctl KERN_ARND)
892908
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
893909
#include <sys/sysctl.h>]],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2019 The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
#
7+
# Test for deterministic coverage across unit test runs.
8+
9+
export LC_ALL=C
10+
11+
# Use GCOV_EXECUTABLE="gcov" if compiling with gcc.
12+
# Use GCOV_EXECUTABLE="llvm-cov gcov" if compiling with clang.
13+
GCOV_EXECUTABLE="gcov"
14+
15+
# Disable tests known to cause non-deterministic behaviour and document the source or point of non-determinism.
16+
NON_DETERMINISTIC_TESTS=(
17+
"dummy_tests" # We currently don't have any unit tests that have determinism issues
18+
)
19+
20+
TEST_BITCOIN_BINARY="src/test/test_pivx"
21+
22+
print_usage() {
23+
echo "Usage: $0 [custom test filter (default: all but known non-deterministic tests)] [number of test runs (default: 2)]"
24+
}
25+
26+
N_TEST_RUNS=2
27+
BOOST_TEST_RUN_FILTERS=""
28+
if [[ $# != 0 ]]; then
29+
if [[ $1 == "--help" ]]; then
30+
print_usage
31+
exit
32+
fi
33+
PARSED_ARGUMENTS=0
34+
if [[ $1 =~ [a-z] ]]; then
35+
BOOST_TEST_RUN_FILTERS=$1
36+
PARSED_ARGUMENTS=$((PARSED_ARGUMENTS + 1))
37+
shift
38+
fi
39+
if [[ $1 =~ ^[0-9]+$ ]]; then
40+
N_TEST_RUNS=$1
41+
PARSED_ARGUMENTS=$((PARSED_ARGUMENTS + 1))
42+
shift
43+
fi
44+
if [[ ${PARSED_ARGUMENTS} == 0 || $# -gt 2 || ${N_TEST_RUNS} -lt 2 ]]; then
45+
print_usage
46+
exit
47+
fi
48+
fi
49+
if [[ ${BOOST_TEST_RUN_FILTERS} == "" ]]; then
50+
BOOST_TEST_RUN_FILTERS="$(IFS=":"; echo "!${NON_DETERMINISTIC_TESTS[*]}" | sed 's/:/:!/g')"
51+
else
52+
echo "Using Boost test filter: ${BOOST_TEST_RUN_FILTERS}"
53+
echo
54+
fi
55+
56+
if ! command -v gcov > /dev/null; then
57+
echo "Error: gcov not installed. Exiting."
58+
exit 1
59+
fi
60+
61+
if ! command -v gcovr > /dev/null; then
62+
echo "Error: gcovr not installed. Exiting."
63+
exit 1
64+
fi
65+
66+
if [[ ! -e ${TEST_BITCOIN_BINARY} ]]; then
67+
echo "Error: Executable ${TEST_BITCOIN_BINARY} not found. Run \"./configure --enable-lcov\" and compile."
68+
exit 1
69+
fi
70+
71+
get_file_suffix_count() {
72+
find src/ -type f -name "*.$1" | wc -l
73+
}
74+
75+
if [[ $(get_file_suffix_count gcno) == 0 ]]; then
76+
echo "Error: Could not find any *.gcno files. The *.gcno files are generated by the compiler. Run \"./configure --enable-lcov\" and re-compile."
77+
exit 1
78+
fi
79+
80+
get_covr_filename() {
81+
echo "gcovr.run-$1.txt"
82+
}
83+
84+
TEST_RUN_ID=0
85+
while [[ ${TEST_RUN_ID} -lt ${N_TEST_RUNS} ]]; do
86+
TEST_RUN_ID=$((TEST_RUN_ID + 1))
87+
echo "[$(date +"%Y-%m-%d %H:%M:%S")] Measuring coverage, run #${TEST_RUN_ID} of ${N_TEST_RUNS}"
88+
find src/ -type f -name "*.gcda" -exec rm {} \;
89+
if [[ $(get_file_suffix_count gcda) != 0 ]]; then
90+
echo "Error: Stale *.gcda files found. Exiting."
91+
exit 1
92+
fi
93+
TEST_OUTPUT_TEMPFILE=$(mktemp)
94+
if ! BOOST_TEST_RUN_FILTERS="${BOOST_TEST_RUN_FILTERS}" ${TEST_BITCOIN_BINARY} > "${TEST_OUTPUT_TEMPFILE}" 2>&1; then
95+
cat "${TEST_OUTPUT_TEMPFILE}"
96+
rm "${TEST_OUTPUT_TEMPFILE}"
97+
exit 1
98+
fi
99+
rm "${TEST_OUTPUT_TEMPFILE}"
100+
if [[ $(get_file_suffix_count gcda) == 0 ]]; then
101+
echo "Error: Running the test suite did not create any *.gcda files. The gcda files are generated when the instrumented test programs are executed. Run \"./configure --enable-lcov\" and re-compile."
102+
exit 1
103+
fi
104+
GCOVR_TEMPFILE=$(mktemp)
105+
if ! gcovr --gcov-executable "${GCOV_EXECUTABLE}" -r src/ > "${GCOVR_TEMPFILE}"; then
106+
echo "Error: gcovr failed. Output written to ${GCOVR_TEMPFILE}. Exiting."
107+
exit 1
108+
fi
109+
GCOVR_FILENAME=$(get_covr_filename ${TEST_RUN_ID})
110+
mv "${GCOVR_TEMPFILE}" "${GCOVR_FILENAME}"
111+
if grep -E "^TOTAL *0 *0 " "${GCOVR_FILENAME}"; then
112+
echo "Error: Spurious gcovr output. Make sure the correct GCOV_EXECUTABLE variable is set in $0 (\"gcov\" for gcc, \"llvm-cov gcov\" for clang)."
113+
exit 1
114+
fi
115+
if [[ ${TEST_RUN_ID} != 1 ]]; then
116+
COVERAGE_DIFF=$(diff -u "$(get_covr_filename 1)" "${GCOVR_FILENAME}")
117+
if [[ ${COVERAGE_DIFF} != "" ]]; then
118+
echo
119+
echo "The line coverage is non-deterministic between runs. Exiting."
120+
echo
121+
echo "The test suite must be deterministic in the sense that the set of lines executed at least"
122+
echo "once must be identical between runs. This is a necessary condition for meaningful"
123+
echo "coverage measuring."
124+
echo
125+
echo "${COVERAGE_DIFF}"
126+
exit 1
127+
fi
128+
rm "${GCOVR_FILENAME}"
129+
fi
130+
done
131+
132+
echo
133+
echo "Coverage test passed: Deterministic coverage across ${N_TEST_RUNS} runs."
134+
exit

src/Makefile.am

+3
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ BITCOIN_CORE_H = \
165165
coins.h \
166166
compat.h \
167167
compat/byteswap.h \
168+
compat/cpuid.h \
168169
compat/endian.h \
169170
compat/sanity.h \
170171
compressor.h \
@@ -239,6 +240,7 @@ BITCOIN_CORE_H = \
239240
protocol.h \
240241
pubkey.h \
241242
random.h \
243+
randomenv.h \
242244
reverselock.h \
243245
reverse_iterate.h \
244246
rpc/client.h \
@@ -538,6 +540,7 @@ libbitcoin_util_a_SOURCES = \
538540
interfaces/handler.cpp \
539541
logging.cpp \
540542
random.cpp \
543+
randomenv.cpp \
541544
rpc/protocol.cpp \
542545
support/cleanse.cpp \
543546
support/lockedpool.cpp \

src/Makefile.bench.include

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ bench_bench_pivx_SOURCES = \
1515
bench/base58.cpp \
1616
bench/checkblock.cpp \
1717
bench/checkqueue.cpp \
18+
bench/chacha20.cpp \
1819
bench/crypto_hash.cpp \
1920
bench/lockedpool.cpp \
2021
bench/perf.cpp \

src/addrman.cpp

+11-15
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void CAddrMan::Good_(const CService& addr, bool test_before_evict, int64_t nTime
219219
return;
220220

221221
// find a bucket it is in now
222-
int nRnd = RandomInt(ADDRMAN_NEW_BUCKET_COUNT);
222+
int nRnd = insecure_rand.randrange(ADDRMAN_NEW_BUCKET_COUNT);
223223
int nUBucket = -1;
224224
for (unsigned int n = 0; n < ADDRMAN_NEW_BUCKET_COUNT; n++) {
225225
int nB = (n + nRnd) % ADDRMAN_NEW_BUCKET_COUNT;
@@ -295,7 +295,7 @@ bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimeP
295295
int nFactor = 1;
296296
for (int n = 0; n < pinfo->nRefCount; n++)
297297
nFactor *= 2;
298-
if (nFactor > 1 && (RandomInt(nFactor) != 0))
298+
if (nFactor > 1 && (insecure_rand.randrange(nFactor) != 0))
299299
return false;
300300
} else {
301301
pinfo = Create(addr, source, &nId);
@@ -359,37 +359,37 @@ CAddrInfo CAddrMan::Select_(bool newOnly)
359359
return CAddrInfo();
360360

361361
// Use a 50% chance for choosing between tried and new table entries.
362-
if (!newOnly && (nTried > 0 && (nNew == 0 || RandomInt(2) == 0))) {
362+
if (!newOnly && (nTried > 0 && (nNew == 0 || insecure_rand.randbool() == 0))) {
363363
// use a tried node
364364
double fChanceFactor = 1.0;
365365
while (1) {
366-
int nKBucket = RandomInt(ADDRMAN_TRIED_BUCKET_COUNT);
367-
int nKBucketPos = RandomInt(ADDRMAN_BUCKET_SIZE);
366+
int nKBucket = insecure_rand.randrange(ADDRMAN_TRIED_BUCKET_COUNT);
367+
int nKBucketPos = insecure_rand.randrange(ADDRMAN_BUCKET_SIZE);
368368
while (vvTried[nKBucket][nKBucketPos] == -1) {
369369
nKBucket = (nKBucket + insecure_rand.randbits(ADDRMAN_TRIED_BUCKET_COUNT_LOG2)) % ADDRMAN_TRIED_BUCKET_COUNT;
370370
nKBucketPos = (nKBucketPos + insecure_rand.randbits(ADDRMAN_BUCKET_SIZE_LOG2)) % ADDRMAN_BUCKET_SIZE;
371371
}
372372
int nId = vvTried[nKBucket][nKBucketPos];
373373
assert(mapInfo.count(nId) == 1);
374374
CAddrInfo& info = mapInfo[nId];
375-
if (RandomInt(1 << 30) < fChanceFactor * info.GetChance() * (1 << 30))
375+
if (insecure_rand.randbits(30) < fChanceFactor * info.GetChance() * (1 << 30))
376376
return info;
377377
fChanceFactor *= 1.2;
378378
}
379379
} else {
380380
// use a new node
381381
double fChanceFactor = 1.0;
382382
while (1) {
383-
int nUBucket = RandomInt(ADDRMAN_NEW_BUCKET_COUNT);
384-
int nUBucketPos = RandomInt(ADDRMAN_BUCKET_SIZE);
383+
int nUBucket = insecure_rand.randrange(ADDRMAN_NEW_BUCKET_COUNT);
384+
int nUBucketPos = insecure_rand.randrange(ADDRMAN_BUCKET_SIZE);
385385
while (vvNew[nUBucket][nUBucketPos] == -1) {
386386
nUBucket = (nUBucket + insecure_rand.randbits(ADDRMAN_NEW_BUCKET_COUNT_LOG2)) % ADDRMAN_NEW_BUCKET_COUNT;
387387
nUBucketPos = (nUBucketPos + insecure_rand.randbits(ADDRMAN_BUCKET_SIZE_LOG2)) % ADDRMAN_BUCKET_SIZE;
388388
}
389389
int nId = vvNew[nUBucket][nUBucketPos];
390390
assert(mapInfo.count(nId) == 1);
391391
CAddrInfo& info = mapInfo[nId];
392-
if (RandomInt(1 << 30) < fChanceFactor * info.GetChance() * (1 << 30))
392+
if (insecure_rand.randbits(30) < fChanceFactor * info.GetChance() * (1 << 30))
393393
return info;
394394
fChanceFactor *= 1.2;
395395
}
@@ -485,7 +485,7 @@ void CAddrMan::GetAddr_(std::vector<CAddress>& vAddr)
485485
if (vAddr.size() >= nNodes)
486486
break;
487487

488-
int nRndPos = RandomInt(vRandom.size() - n) + n;
488+
int nRndPos = insecure_rand.randrange(vRandom.size() - n) + n;
489489
SwapRandom(n, nRndPos);
490490
assert(mapInfo.count(vRandom[n]) == 1);
491491

@@ -533,10 +533,6 @@ void CAddrMan::SetServices_(const CService& addr, ServiceFlags nServices)
533533
info.nServices = nServices;
534534
}
535535

536-
int CAddrMan::RandomInt(int nMax){
537-
return GetRandInt(nMax);
538-
}
539-
540536
void CAddrMan::ResolveCollisions_()
541537
{
542538
for (std::set<int>::iterator it = m_tried_collisions.begin(); it != m_tried_collisions.end();) {
@@ -603,7 +599,7 @@ CAddrInfo CAddrMan::SelectTriedCollision_()
603599
std::set<int>::iterator it = m_tried_collisions.begin();
604600

605601
// Selects a random element from m_tried_collisions
606-
std::advance(it, GetRandInt(m_tried_collisions.size()));
602+
std::advance(it, insecure_rand.randrange(m_tried_collisions.size()));
607603
int id_new = *it;
608604

609605
// If id_new not found in mapInfo remove it from m_tried_collisions

src/addrman.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,6 @@ class CAddrMan
269269
//! Return a random to-be-evicted tried table address.
270270
CAddrInfo SelectTriedCollision_() EXCLUSIVE_LOCKS_REQUIRED(cs);
271271

272-
//! Wraps GetRandInt to allow tests to override RandomInt and make it determinismistic.
273-
virtual int RandomInt(int nMax);
274-
275272
#ifdef DEBUG_ADDRMAN
276273
//! Perform consistency check. Returns an error code or zero.
277274
int Check_() EXCLUSIVE_LOCKS_REQUIRED(cs);
@@ -469,7 +466,7 @@ class CAddrMan
469466
{
470467
LOCK(cs);
471468
std::vector<int>().swap(vRandom);
472-
nKey = GetRandHash();
469+
nKey = insecure_rand.rand256();
473470
for (size_t bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) {
474471
for (size_t entry = 0; entry < ADDRMAN_BUCKET_SIZE; entry++) {
475472
vvNew[bucket][entry] = -1;

0 commit comments

Comments
 (0)