diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2011-11-10 21:12:46 -0500 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2011-11-15 09:30:16 -0500 |
commit | d764d9161e548c7fbf835b70eb9d5c75caa28ff5 (patch) | |
tree | d94d3cf42bee7df401ac44a9c6c0181981a416b0 /src/bitcoinrpc.cpp | |
parent | 9e9869d0fe9c5cb38273a557e28b1922356d0e11 (diff) |
Obsolete keypool and make sure database removes log files on shutdown.
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r-- | src/bitcoinrpc.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 24864030c1..31ef725d79 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1557,6 +1557,11 @@ Value encryptwallet(const Array& params, bool fHelp) if (pwalletMain->IsCrypted()) throw JSONRPCError(-15, "Error: running with an encrypted wallet, but encryptwallet was called."); +#ifdef QT_GUI + // shutting down via RPC while the GUI is running does not work (yet): + throw runtime_error("Not Yet Implemented: use GUI to encrypt wallet, not RPC command"); +#endif + string strWalletPass; strWalletPass.reserve(100); mlock(&strWalletPass[0], strWalletPass.capacity()); @@ -1576,7 +1581,11 @@ Value encryptwallet(const Array& params, bool fHelp) fill(strWalletPass.begin(), strWalletPass.end(), '\0'); munlock(&strWalletPass[0], strWalletPass.capacity()); - return Value::null; + // BDB seems to have a bad habit of writing old data into + // slack space in .dat files; that is bad if the old data is + // unencrypted private keys. So: + CreateThread(Shutdown, NULL); + return "wallet encrypted; bitcoin server stopping, restart to run with encrypted wallet"; } |