Remove uint256.h from util header
authorsvost <ya.nowa@yandex.ru>
Thu, 9 Feb 2017 05:45:07 +0000 (08:45 +0300)
committersvost <ya.nowa@yandex.ru>
Thu, 9 Feb 2017 05:45:07 +0000 (08:45 +0300)
src/bignum.h
src/uint256.cpp
src/uint256.h
src/util.cpp
src/util.h

index 441c960..60c4b4c 100644 (file)
@@ -7,8 +7,11 @@
 
 #include <stdexcept>
 #include <vector>
+
 #include <openssl/bn.h>
+
 #include "util.h"
+#include "uint256.h"
 
 /** Errors thrown by the bignum class */
 class bignum_error : public std::runtime_error
index aad4bac..e4b5f37 100644 (file)
@@ -7,7 +7,9 @@
 #include <stdio.h>
 #include <string.h>
 #include <cassert>
-#include  <stdexcept>
+#include <stdexcept>
+
+#include <openssl/rand.h>
 
 #include "uint256.h"
 
@@ -215,3 +217,10 @@ uint256::uint256(const std::vector<unsigned char>& vch)
     else
         *this = 0;
 }
+
+uint256 GetRandHash()
+{
+    uint256 hash;
+    RAND_bytes(hash.begin(), hash.size());
+    return hash;
+}
index d6cd23f..4d60835 100644 (file)
@@ -584,4 +584,6 @@ inline const uint256 operator|(const uint256& a, const uint256& b)      { return
 inline const uint256 operator+(const uint256& a, const uint256& b)      { return (base_uint256)a +  (base_uint256)b; }
 inline const uint256 operator-(const uint256& a, const uint256& b)      { return (base_uint256)a -  (base_uint256)b; }
 
+uint256 GetRandHash();
+
 #endif
index a63ca2c..942668e 100644 (file)
@@ -181,13 +181,6 @@ int GetRandInt(int nMax)
     return static_cast<int>(GetRand(nMax));
 }
 
-uint256 GetRandHash()
-{
-    uint256 hash;
-    RAND_bytes(hash.begin(), hash.size());
-    return hash;
-}
-
 void FillRand(uint8_t *buffer, size_t nCount)
 {
     RAND_bytes(buffer, nCount);
index 5e21222..84a7090 100644 (file)
@@ -5,9 +5,6 @@
 #ifndef BITCOIN_UTIL_H
 #define BITCOIN_UTIL_H
 
-
-#include "uint256.h"
-
 #ifndef WIN32
 #include <sys/types.h>
 #include <sys/time.h>
@@ -225,7 +222,6 @@ boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
 void ShrinkDebugFile();
 int GetRandInt(int nMax);
 uint64_t GetRand(uint64_t nMax);
-uint256 GetRandHash();
 void FillRand(uint8_t *buffer, size_t nCount);
 int64_t GetTime();
 int64_t GetTimeMillis();