From c0f33babed9e5e9f6dc276249f31725accd9b320 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Wed, 25 Oct 2017 12:54:31 +0200
Subject: [PATCH] eth: use dht random_device

Use random_device from OpenDHT to
profit of the fallback on MinGW.

Change-Id: I00d0221d30c298f4342950a404fc2980e702e10b
Reviewed-by: Olivier Soldano <olivier.soldano@savoirfairelinux.com>
---
 src/ringdht/eth/libdevcore/FixedHash.cpp | 2 +-
 src/ringdht/eth/libdevcore/FixedHash.h   | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ringdht/eth/libdevcore/FixedHash.cpp b/src/ringdht/eth/libdevcore/FixedHash.cpp
index 51186e1fdf..c7d24b529a 100644
--- a/src/ringdht/eth/libdevcore/FixedHash.cpp
+++ b/src/ringdht/eth/libdevcore/FixedHash.cpp
@@ -20,6 +20,6 @@
 namespace dev
 {
 
-std::random_device s_fixedHashEngine;
+dht::crypto::random_device s_fixedHashEngine;
 
 }
diff --git a/src/ringdht/eth/libdevcore/FixedHash.h b/src/ringdht/eth/libdevcore/FixedHash.h
index aed5d9392d..3286c368c0 100644
--- a/src/ringdht/eth/libdevcore/FixedHash.h
+++ b/src/ringdht/eth/libdevcore/FixedHash.h
@@ -28,6 +28,8 @@
 #include <algorithm>
 #include <random>
 #include <sstream>
+#include <opendht/rng.h>
+
 #include "CommonData.h"
 
 namespace dev
@@ -37,7 +39,7 @@ namespace dev
 template <unsigned N> struct StaticLog2 { enum { result = 1 + StaticLog2<N/2>::result }; };
 template <> struct StaticLog2<1> { enum { result = 0 }; };
 
-extern std::random_device s_fixedHashEngine;
+extern dht::crypto::random_device s_fixedHashEngine;
 
 /// Fixed-size raw-byte array container type, with an API optimised for storing hashes.
 /// Transparently converts to/from the corresponding arithmetic type; this will
-- 
GitLab