diff options
| author | fanquake <[email protected]> | 2020-03-17 13:00:31 +0800 |
|---|---|---|
| committer | fanquake <[email protected]> | 2020-03-17 13:00:31 +0800 |
| commit | a8897115626ab6509c67511e50e73c0f7c953c6a (patch) | |
| tree | 111bf07b36f25dc1bb7e99e58d42a49af8971727 /src | |
| parent | Merge #18350: test: Fix mining to an invalid target + ensure that a new block... (diff) | |
| download | discoin-a8897115626ab6509c67511e50e73c0f7c953c6a.tar.xz discoin-a8897115626ab6509c67511e50e73c0f7c953c6a.zip | |
rand: remove getentropy() fallback for macOS < 10.12
Diffstat (limited to 'src')
| -rw-r--r-- | src/random.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/random.cpp b/src/random.cpp index f0082cf3e..f53427c71 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -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 |