Move rand functions from util to new random.h/.cpp
[novacoin.git] / src / db.cpp
index 5b6d66b..78e2495 100644 (file)
@@ -4,10 +4,9 @@
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 
 #include "db.h"
-#include "net.h"
 #include "util.h"
 #include "main.h"
-#include "interface.h"
+
 #include <boost/filesystem.hpp>
 #include <boost/filesystem/fstream.hpp>
 
@@ -16,7 +15,6 @@
 #endif
 
 using namespace std;
-using namespace boost;
 
 
 unsigned int nWalletDBUpdated;
@@ -499,7 +497,7 @@ bool CAddrDB::Write(const CAddrMan& addr)
 {
     // Generate random temporary filename
     unsigned short randv = 0;
-    RAND_bytes((unsigned char *)&randv, sizeof(randv));
+    GetRandBytes((unsigned char *)&randv, sizeof(randv));
     std::string tmpfn = strprintf("peers.dat.%04x", randv);
 
     // serialize addresses, checksum data up to that point, then append csum