Deal with namespace
authorsvost <ya.nowa@yandex.ru>
Mon, 3 Oct 2016 14:31:32 +0000 (17:31 +0300)
committersvost <ya.nowa@yandex.ru>
Mon, 3 Oct 2016 14:31:32 +0000 (17:31 +0300)
src/uint256.h
src/util.h

index 526aa71..d6cd23f 100644 (file)
@@ -11,8 +11,6 @@
 #include <iomanip>
 #include <sstream>
 
-using namespace std;
-
 
 /** Base class without constructors for uint256 and uint160.
  * This makes the compiler let u use it in a union.
@@ -510,7 +508,7 @@ public:
         virtual const char* what() const throw () { return what_.c_str(); }
         virtual ~uint256_error() throw () {}
 private:
-        std::string what_; 
+        std::string what_;
 };
 
 /** 256-bit unsigned integer */
index d787141..7035091 100644 (file)
@@ -115,7 +115,9 @@ T* alignup(T* p)
 #define MAX_PATH            1024
 inline void Sleep(int64_t n)
 {
-    this_thread::sleep_for(std::chrono::milliseconds(n));
+    /*Boost has a year 2038 problem— if the request sleep time is past epoch+2^31 seconds the sleep returns instantly.
+      So we clamp our sleeps here to 10 years and hope that boost is fixed by 2028.*/
+    boost::thread::sleep(boost::get_system_time() + boost::posix_time::milliseconds(n>315576000000LL?315576000000LL:n));
 }
 #endif