Merge pull request #379 from svost/c++11
[novacoin.git] / src / uint256.cpp
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;
+}