diff --git a/src/random.cpp b/src/random.cpp index f0082cf3e0..f7f3dd9de3 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -15,7 +15,7 @@ #endif #include // for LogPrintf() #include // for Mutex -#include // for GetTime() +#include // for GetTimeMicros() #include #include @@ -315,13 +315,10 @@ void GetOSRand(unsigned char *ent32) RandFailure(); } #elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX) - // We need a fallback for OSX < 10.12 - if (&getentropy != nullptr) { - if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) { - RandFailure(); - } - } else { - GetDevURandom(ent32); + /* getentropy() is available on macOS 10.12 and later. + */ + if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) { + RandFailure(); } #elif defined(HAVE_SYSCTL_ARND) /* FreeBSD and similar. It is possible for the call to return less