Mercurial > hg > bitcoin
changeset 3540:7b54aa6a0d98 draft
Merge pull request #1836 from kjj2/stopdetach
Adds a stopdetach <detach> RPC command. <detach> defaults to true. Wor...
author | Wladimir J. van der Laan <laanwj@gmail.com> |
---|---|
date | Sun, 23 Sep 2012 05:49:42 -0700 (2012-09-23) |
parents | 4e80d53b9b09 (current diff) 563db94a9b9e (diff) |
children | 0cf73074b915 a1b38bd347c3 965a4a64a275 |
files | src/bitcoinrpc.cpp |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -9,6 +9,7 @@ #include "ui_interface.h" #include "base58.h" #include "bitcoinrpc.h" +#include "db.h" #undef printf #include <boost/asio.hpp> @@ -173,11 +174,14 @@ Value stop(const Array& params, bool fHelp) { - if (fHelp || params.size() != 0) + if (fHelp || params.size() > 1) throw runtime_error( - "stop\n" - "Stop Bitcoin server."); + "stop <detach>\n" + "<detach> is true or false to detach the database or not for this stop only\n" + "Stop Bitcoin server (and possibly override the detachdb config value)."); // Shutdown will take long enough that the response should get back + if (params.size() > 0) + bitdb.SetDetach(params[0].get_bool()); StartShutdown(); return "Bitcoin server stopping"; } @@ -1126,6 +1130,7 @@ // // Special case non-string parameter types // + if (strMethod == "stop" && n > 0) ConvertTo<bool>(params[0]); if (strMethod == "setgenerate" && n > 0) ConvertTo<bool>(params[0]); if (strMethod == "setgenerate" && n > 1) ConvertTo<boost::int64_t>(params[1]); if (strMethod == "sendtoaddress" && n > 1) ConvertTo<double>(params[1]);