aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2012-03-11 22:21:06 -0400
committerLuke Dashjr <luke-jr+git@utopios.org>2012-03-11 22:21:06 -0400
commitd05c03ab4ed23389b1326f9b7c77a8d7b8d6588d (patch)
treec402523f1548781a1437a1e409b0ca8c7ae7ebf4
parent9cf600e6dabe9133a0c25e87babc42e3a0e1a29a (diff)
parentb4f8c8f5f9ff0f8db6612d7f279976453b18876f (diff)
Merge branch '0.5.0.x' into 0.5.xv0.5.3rc4v0.5.3
-rw-r--r--src/bitcoinrpc.cpp6
-rw-r--r--src/net.cpp2
-rw-r--r--src/util.h4
3 files changed, 7 insertions, 5 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 579d094b44..5be2e0a3db 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -1407,7 +1407,7 @@ void ThreadTopUpKeyPool(void* parg)
void ThreadCleanWalletPassphrase(void* parg)
{
- int64 nMyWakeTime = GetTimeMillis() + *((int*)parg) * 1000;
+ int64 nMyWakeTime = GetTimeMillis() + *((int64*)parg) * 1000;
ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime);
@@ -1443,7 +1443,7 @@ void ThreadCleanWalletPassphrase(void* parg)
LEAVE_CRITICAL_SECTION(cs_nWalletUnlockTime);
- delete (int*)parg;
+ delete (int64*)parg;
}
Value walletpassphrase(const Array& params, bool fHelp)
@@ -1478,7 +1478,7 @@ Value walletpassphrase(const Array& params, bool fHelp)
"Stores the wallet decryption key in memory for <timeout> seconds.");
CreateThread(ThreadTopUpKeyPool, NULL);
- int* pnSleepTime = new int(params[1].get_int());
+ int64* pnSleepTime = new int64(params[1].get_int64());
CreateThread(ThreadCleanWalletPassphrase, pnSleepTime);
return Value::null;
diff --git a/src/net.cpp b/src/net.cpp
index b314405efc..f37c675ff9 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -953,7 +953,7 @@ void ThreadSocketHandler2(void* parg)
}
else if (CNode::IsBanned(addr.ip))
{
- printf("connetion from %s dropped (banned)\n", addr.ToString().c_str());
+ printf("connection from %s dropped (banned)\n", addr.ToString().c_str());
closesocket(hSocket);
}
else
diff --git a/src/util.h b/src/util.h
index 15a45ba7d7..45b14420f1 100644
--- a/src/util.h
+++ b/src/util.h
@@ -115,7 +115,9 @@ typedef u_int SOCKET;
#define Beep(n1,n2) (0)
inline void Sleep(int64 n)
{
- boost::thread::sleep(boost::get_system_time() + boost::posix_time::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