Skip to content

Commit

Permalink
Merge branch '0.5.0.x' into 0.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Mar 12, 2012
2 parents 9cf600e + b4f8c8f commit d05c03a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/bitcoinrpc.cpp
Expand Up @@ -1407,7 +1407,7 @@ void ThreadTopUpKeyPool(void* parg)


void ThreadCleanWalletPassphrase(void* parg) void ThreadCleanWalletPassphrase(void* parg)
{ {
int64 nMyWakeTime = GetTimeMillis() + *((int*)parg) * 1000; int64 nMyWakeTime = GetTimeMillis() + *((int64*)parg) * 1000;


ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime); ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime);


Expand Down Expand Up @@ -1443,7 +1443,7 @@ void ThreadCleanWalletPassphrase(void* parg)


LEAVE_CRITICAL_SECTION(cs_nWalletUnlockTime); LEAVE_CRITICAL_SECTION(cs_nWalletUnlockTime);


delete (int*)parg; delete (int64*)parg;
} }


Value walletpassphrase(const Array& params, bool fHelp) Value walletpassphrase(const Array& params, bool fHelp)
Expand Down Expand Up @@ -1478,7 +1478,7 @@ Value walletpassphrase(const Array& params, bool fHelp)
"Stores the wallet decryption key in memory for <timeout> seconds."); "Stores the wallet decryption key in memory for <timeout> seconds.");


CreateThread(ThreadTopUpKeyPool, NULL); CreateThread(ThreadTopUpKeyPool, NULL);
int* pnSleepTime = new int(params[1].get_int()); int64* pnSleepTime = new int64(params[1].get_int64());
CreateThread(ThreadCleanWalletPassphrase, pnSleepTime); CreateThread(ThreadCleanWalletPassphrase, pnSleepTime);


return Value::null; return Value::null;
Expand Down
2 changes: 1 addition & 1 deletion src/net.cpp
Expand Up @@ -953,7 +953,7 @@ void ThreadSocketHandler2(void* parg)
} }
else if (CNode::IsBanned(addr.ip)) 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); closesocket(hSocket);
} }
else else
Expand Down
4 changes: 3 additions & 1 deletion src/util.h
Expand Up @@ -115,7 +115,9 @@ typedef u_int SOCKET;
#define Beep(n1,n2) (0) #define Beep(n1,n2) (0)
inline void Sleep(int64 n) 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 #endif


Expand Down

0 comments on commit d05c03a

Please sign in to comment.