diff options
| author | Gregory Maxwell <[email protected]> | 2012-03-10 16:05:28 -0500 |
|---|---|---|
| committer | Gregory Maxwell <[email protected]> | 2012-03-10 17:38:37 -0500 |
| commit | 82a10c81707dcff5ee24dec7ef7ebf8eccfded03 (patch) | |
| tree | 7629dc24efea6c45289478741b4b01b60128c7d6 /src/bitcoinrpc.cpp | |
| parent | Merge pull request #918 from nomnombtc/patch-1 (diff) | |
| download | discoin-82a10c81707dcff5ee24dec7ef7ebf8eccfded03.tar.xz discoin-82a10c81707dcff5ee24dec7ef7ebf8eccfded03.zip | |
Resolves issue #922 - "wallet passphrase timeout of several years doesn't work"
2^31 milliseconds is only about 25 days. Also clamps Sleep() to 10 years,
because it currently sleeps for 0 seconds when the sleep time would cross
2^31 seconds since the epoch. Hopefully boost will be fixed by 2028.
Diffstat (limited to 'src/bitcoinrpc.cpp')
| -rw-r--r-- | src/bitcoinrpc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 68cc17b51..5571c344a 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1548,7 +1548,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); @@ -1584,7 +1584,7 @@ void ThreadCleanWalletPassphrase(void* parg) LEAVE_CRITICAL_SECTION(cs_nWalletUnlockTime); - delete (int*)parg; + delete (int64*)parg; } Value walletpassphrase(const Array& params, bool fHelp) @@ -1619,7 +1619,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; |