8 #if defined(HAVE_CONFIG_H)
23 #include <boost/algorithm/string.hpp>
24 #include <boost/asio.hpp>
25 #include <boost/asio/ssl.hpp>
26 #include <boost/bind.hpp>
27 #include <boost/filesystem.hpp>
28 #include <boost/foreach.hpp>
29 #include <boost/iostreams/concepts.hpp>
30 #include <boost/iostreams/stream.hpp>
31 #include <boost/shared_ptr.hpp>
32 #include "json/json_spirit_writer_template.h"
35 using namespace boost;
39 static std::string strRPCUserColonPass;
42 static asio::io_service* rpc_io_service = NULL;
43 static map<string, boost::shared_ptr<deadline_timer> > deadlineTimers;
44 static ssl::context* rpc_ssl_context = NULL;
45 static boost::thread_group* rpc_worker_group = NULL;
46 static boost::asio::io_service::work *rpc_dummy_work = NULL;
47 static std::vector< boost::shared_ptr<ip::tcp::acceptor> > rpc_acceptors;
50 const list<Value_type>& typesExpected,
54 BOOST_FOREACH(Value_type t, typesExpected)
56 if (params.size() <= i)
59 const Value& v = params[i];
60 if (!((v.type() == t) || (fAllowNull && (v.type() == null_type))))
62 string err =
strprintf(
"Expected type %s, got %s",
63 Value_type_name[t], Value_type_name[v.type()]);
71 const map<string, Value_type>& typesExpected,
74 BOOST_FOREACH(
const PAIRTYPE(
string, Value_type)& t, typesExpected)
76 const Value& v = find_value(o, t.first);
77 if (!fAllowNull && v.type() == null_type)
80 if (!((v.type() == t.second) || (fAllowNull && (v.type() == null_type))))
82 string err =
strprintf(
"Expected type %s for %s, got %s",
83 Value_type_name[t.second], t.first, Value_type_name[v.type()]);
91 double dAmount = value.get_real();
92 if (dAmount <= 0.0 || dAmount > 84000000.0)
102 return (
double)amount / (double)COIN;
111 uBits.nBits = htonl((int32_t)nBits);
118 if (v.type() == str_type)
119 strHex = v.get_str();
128 return ParseHashV(find_value(o, strKey), strKey);
130 vector<unsigned char>
ParseHexV(
const Value& v,
string strName)
133 if (v.type() == str_type)
134 strHex = v.get_str();
139 vector<unsigned char>
ParseHexO(
const Object& o,
string strKey)
141 return ParseHexV(find_value(o, strKey), strKey);
152 set<rpcfn_type> setDone;
153 for (map<string, const CRPCCommand*>::const_iterator mi = mapCommands.begin(); mi != mapCommands.end(); ++mi)
156 string strMethod = mi->first;
158 if (strMethod.find(
"label") != string::npos)
160 if (strCommand !=
"" && strMethod != strCommand)
171 if (setDone.insert(pfn).second)
172 (*pfn)(params,
true);
174 catch (std::exception& e)
177 string strHelp = string(e.what());
178 if (strCommand ==
"")
179 if (strHelp.find(
'\n') != string::npos)
180 strHelp = strHelp.substr(0, strHelp.find(
'\n'));
181 strRet += strHelp +
"\n";
185 strRet =
strprintf(
"help: unknown command: %s\n", strCommand);
186 strRet = strRet.substr(0,strRet.size()-1);
190 Value
help(
const Array& params,
bool fHelp)
192 if (fHelp || params.size() > 1)
194 "help ( \"command\" )\n"
195 "\nList all commands, or get help for a specified command.\n"
197 "1. \"command\" (string, optional) The command to get help on\n"
199 "\"text\" (string) The help text\n"
203 if (params.size() > 0)
204 strCommand = params[0].get_str();
210 Value
stop(
const Array& params,
bool fHelp)
213 if (fHelp || params.size() > 1)
216 "\nStop Anoncoin server.");
219 return "Anoncoin server stopping";
233 {
"getinfo", &
getinfo,
true,
false,
false },
234 {
"help", &
help,
true,
true,
false },
235 {
"stop", &
stop,
true,
true,
false },
239 {
"addnode", &
addnode,
true,
true,
false },
243 {
"getpeerinfo", &
getpeerinfo,
true,
false,
false },
244 {
"ping", &
ping,
true,
false,
false },
250 {
"getblock", &
getblock,
false,
false,
false },
254 {
"gettxout", &
gettxout,
true,
false,
false },
256 {
"verifychain", &
verifychain,
true,
false,
false },
262 {
"submitblock", &
submitblock,
false,
false,
false },
281 {
"dumpprivkey", &
dumpprivkey,
true,
false,
true },
282 {
"dumpwallet", &
dumpwallet,
true,
false,
true },
285 {
"getaccount", &
getaccount,
false,
false,
true },
287 {
"getbalance", &
getbalance,
false,
false,
true },
306 {
"makekeypair", &
makekeypair,
true,
false,
true },
307 {
"dumpprivkey", &
dumpprivkey,
true,
false,
true },
308 {
"listunspent", &
listunspent,
false,
false,
true },
309 {
"lockunspent", &
lockunspent,
false,
false,
true },
310 {
"move", &
movecmd,
false,
false,
true },
311 {
"sendfrom", &
sendfrom,
false,
false,
true },
312 {
"sendmany", &
sendmany,
false,
false,
true },
314 {
"setaccount", &
setaccount,
true,
false,
true },
315 {
"settxfee", &
settxfee,
false,
false,
true },
316 {
"signmessage", &
signmessage,
false,
false,
true },
317 {
"walletlock", &
walletlock,
true,
false,
true },
322 {
"getgenerate", &
getgenerate,
true,
false,
false },
324 {
"getwork", &
getwork,
true,
false,
true },
325 {
"setgenerate", &
setgenerate,
true,
true,
false },
326 #endif // ENABLE_WALLET
332 for (vcidx = 0; vcidx < (
sizeof(vRPCCommands) /
sizeof(vRPCCommands[0])); vcidx++)
336 pcmd = &vRPCCommands[vcidx];
337 mapCommands[pcmd->
name] = pcmd;
343 map<string, const CRPCCommand*>::const_iterator it = mapCommands.find(name);
344 if (it == mapCommands.end())
352 string strAuth = mapHeaders[
"authorization"];
353 if (strAuth.substr(0,6) !=
"Basic ")
355 string strUserPass64 = strAuth.substr(6); boost::trim(strUserPass64);
360 void ErrorReply(std::ostream& stream,
const Object& objError,
const Value&
id)
364 int code = find_value(objError,
"code").get_int();
367 string strReply =
JSONRPCReply(Value::null, objError,
id);
368 stream <<
HTTPReply(nStatus, strReply,
false) << std::flush;
375 && (address.to_v6().is_v4_compatible()
376 || address.to_v6().is_v4_mapped()))
379 if (address == asio::ip::address_v4::loopback()
380 || address == asio::ip::address_v6::loopback()
383 && (address.to_v4().to_ulong() & 0xff000000) == 0x7f000000))
386 const string strAddress = address.to_string();
387 const vector<string>& vAllow =
mapMultiArgs[
"-rpcallowip"];
388 BOOST_FOREACH(
string strAllow, vAllow)
399 virtual std::iostream& stream() = 0;
400 virtual std::string peer_address_to_string()
const = 0;
401 virtual void close() = 0;
404 template <
typename Protocol>
409 asio::io_service& io_service,
410 ssl::context &context,
412 sslStream(io_service, context),
413 _d(sslStream, fUseSSL),
425 return peer.address().to_string();
433 typename Protocol::endpoint
peer;
438 iostreams::stream< SSLIOStreamDevice<Protocol> >
_stream;
444 template <
typename Protocol,
typename SocketAcceptorService>
445 static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
446 ssl::context& context,
448 boost::shared_ptr< AcceptedConnection > conn,
449 const boost::system::error_code& error);
454 template <
typename Protocol,
typename SocketAcceptorService>
455 static void RPCListen(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
456 ssl::context& context,
462 acceptor->async_accept(
463 conn->sslStream.lowest_layer(),
465 boost::bind(&RPCAcceptHandler<Protocol, SocketAcceptorService>,
477 template <
typename Protocol,
typename SocketAcceptorService>
478 static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketAcceptorService> > acceptor,
479 ssl::context& context,
481 boost::shared_ptr< AcceptedConnection > conn,
482 const boost::system::error_code& error)
485 if (error != asio::error::operation_aborted && acceptor->is_open())
486 RPCListen(acceptor, context, fUseSSL);
493 LogPrintf(
"%s: Error: %s\n", __func__, error.message());
513 strRPCUserColonPass =
mapArgs[
"-rpcuser"] +
":" +
mapArgs[
"-rpcpassword"];
514 if (((mapArgs[
"-rpcpassword"] ==
"") ||
515 (mapArgs[
"-rpcuser"] == mapArgs[
"-rpcpassword"])) &&
Params().RequireRPCPassword())
517 unsigned char rand_pwd[32];
518 RAND_bytes(rand_pwd, 32);
519 string strWhatAmI =
"To use anoncoind";
520 if (mapArgs.count(
"-server"))
521 strWhatAmI =
strprintf(
_(
"To use the %s option"),
"\"-server\"");
522 else if (mapArgs.count(
"-daemon"))
523 strWhatAmI =
strprintf(
_(
"To use the %s option"),
"\"-daemon\"");
525 _(
"%s, you must set a rpcpassword in the configuration file:\n"
527 "It is recommended you use the following random password:\n"
528 "rpcuser=anoncoinrpc\n"
530 "(you do not need to remember this password)\n"
531 "The username and password MUST NOT be the same.\n"
532 "If the file does not exist, create it with owner-readable-only file permissions.\n"
533 "It is also recommended to set alertnotify so you are notified of problems;\n"
534 "for example: alertnotify=echo %%s | mail -s \"Anoncoin Alert\" admin@foo.com\n"),
543 assert(rpc_io_service == NULL);
544 rpc_io_service =
new asio::io_service();
545 rpc_ssl_context =
new ssl::context(*rpc_io_service, ssl::context::sslv23);
547 const bool fUseSSL =
GetBoolArg(
"-rpcssl",
false);
551 rpc_ssl_context->set_options(ssl::context::no_sslv2);
553 filesystem::path pathCertFile(
GetArg(
"-rpcsslcertificatechainfile",
"server.cert"));
554 if (!pathCertFile.is_complete()) pathCertFile = filesystem::path(
GetDataDir()) / pathCertFile;
555 if (filesystem::exists(pathCertFile)) rpc_ssl_context->use_certificate_chain_file(pathCertFile.string());
556 else LogPrintf(
"ThreadRPCServer ERROR: missing server certificate file %s\n", pathCertFile.string());
558 filesystem::path pathPKFile(
GetArg(
"-rpcsslprivatekeyfile",
"server.pem"));
559 if (!pathPKFile.is_complete()) pathPKFile = filesystem::path(
GetDataDir()) / pathPKFile;
560 if (filesystem::exists(pathPKFile)) rpc_ssl_context->use_private_key_file(pathPKFile.string(), ssl::context::pem);
561 else LogPrintf(
"ThreadRPCServer ERROR: missing server private key file %s\n", pathPKFile.string());
563 string strCiphers =
GetArg(
"-rpcsslciphers",
"TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH");
564 SSL_CTX_set_cipher_list(rpc_ssl_context->impl(), strCiphers.c_str());
568 const bool loopback = !mapArgs.count(
"-rpcallowip");
569 asio::ip::address bindAddress = loopback ? asio::ip::address_v6::loopback() : asio::ip::address_v6::any();
570 ip::tcp::endpoint endpoint(bindAddress,
GetArg(
"-rpcport",
Params().RPCPort()));
571 boost::system::error_code v6_only_error;
573 bool fListening =
false;
577 boost::shared_ptr<ip::tcp::acceptor> acceptor(
new ip::tcp::acceptor(*rpc_io_service));
578 acceptor->open(endpoint.protocol());
579 acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(
true));
582 acceptor->set_option(boost::asio::ip::v6_only(loopback), v6_only_error);
584 acceptor->bind(endpoint);
585 acceptor->listen(socket_base::max_connections);
587 RPCListen(acceptor, *rpc_ssl_context, fUseSSL);
589 rpc_acceptors.push_back(acceptor);
592 catch(boost::system::system_error &e)
594 strerr =
strprintf(
_(
"An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s"), endpoint.port(), e.what());
598 if (!fListening || loopback || v6_only_error)
600 bindAddress = loopback ? asio::ip::address_v4::loopback() : asio::ip::address_v4::any();
601 endpoint.address(bindAddress);
603 boost::shared_ptr<ip::tcp::acceptor> acceptor(
new ip::tcp::acceptor(*rpc_io_service));
604 acceptor->open(endpoint.protocol());
605 acceptor->set_option(boost::asio::ip::tcp::acceptor::reuse_address(
true));
606 acceptor->bind(endpoint);
607 acceptor->listen(socket_base::max_connections);
609 RPCListen(acceptor, *rpc_ssl_context, fUseSSL);
611 rpc_acceptors.push_back(acceptor);
615 catch(boost::system::system_error &e)
617 strerr =
strprintf(
_(
"An error occurred while setting up the RPC port %u for listening on IPv4: %s"), endpoint.port(), e.what());
626 rpc_worker_group =
new boost::thread_group();
627 for (
int i = 0; i <
GetArg(
"-rpcthreads", 4); i++)
628 rpc_worker_group->create_thread(boost::bind(&asio::io_service::run, rpc_io_service));
633 if(rpc_io_service == NULL)
635 rpc_io_service =
new asio::io_service();
638 rpc_dummy_work =
new asio::io_service::work(*rpc_io_service);
639 rpc_worker_group =
new boost::thread_group();
640 rpc_worker_group->create_thread(boost::bind(&asio::io_service::run, rpc_io_service));
646 if (rpc_io_service == NULL)
return;
651 boost::system::error_code ec;
652 BOOST_FOREACH(
const boost::shared_ptr<ip::tcp::acceptor> &acceptor, rpc_acceptors)
654 acceptor->cancel(ec);
656 LogPrintf(
"%s: Warning: %s when cancelling acceptor", __func__, ec.message());
658 rpc_acceptors.clear();
659 BOOST_FOREACH(
const PAIRTYPE(std::string, boost::shared_ptr<deadline_timer>) &
timer, deadlineTimers)
661 timer.second->cancel(ec);
663 LogPrintf(
"%s: Warning: %s when cancelling timer", __func__, ec.message());
665 deadlineTimers.clear();
667 rpc_io_service->stop();
668 if (rpc_worker_group != NULL)
669 rpc_worker_group->join_all();
670 delete rpc_dummy_work; rpc_dummy_work = NULL;
671 delete rpc_worker_group; rpc_worker_group = NULL;
672 delete rpc_ssl_context; rpc_ssl_context = NULL;
673 delete rpc_io_service; rpc_io_service = NULL;
676 void RPCRunHandler(
const boost::system::error_code& err, boost::function<
void(
void)> func)
682 void RPCRunLater(
const std::string& name, boost::function<
void(
void)> func, int64_t nSeconds)
684 assert(rpc_io_service != NULL);
686 if (deadlineTimers.count(name) == 0)
688 deadlineTimers.insert(make_pair(name,
689 boost::shared_ptr<deadline_timer>(
new deadline_timer(*rpc_io_service))));
691 deadlineTimers[name]->expires_from_now(posix_time::seconds(nSeconds));
692 deadlineTimers[name]->async_wait(boost::bind(
RPCRunHandler, _1, func));
703 void parse(
const Value& valRequest);
709 if (valRequest.type() != obj_type)
711 const Object& request = valRequest.get_obj();
714 id = find_value(request,
"id");
717 Value valMethod = find_value(request,
"method");
718 if (valMethod.type() == null_type)
720 if (valMethod.type() != str_type)
722 strMethod = valMethod.get_str();
723 if (strMethod !=
"getwork" && strMethod !=
"getblocktemplate")
724 LogPrint(
"rpc",
"ThreadRPCServer method=%s\n", strMethod);
727 Value valParams = find_value(request,
"params");
728 if (valParams.type() == array_type)
729 params = valParams.get_array();
730 else if (valParams.type() == null_type)
737 static Object JSONRPCExecOne(
const Value& req)
748 catch (Object& objError)
752 catch (std::exception& e)
761 static string JSONRPCExecBatch(
const Array& vReq)
764 for (
unsigned int reqIdx = 0; reqIdx < vReq.size(); reqIdx++)
765 ret.push_back(JSONRPCExecOne(vReq[reqIdx]));
767 return write_string(Value(ret),
false) +
"\n";
776 map<string, string> mapHeaders;
777 string strRequest, strMethod, strURI;
792 if (mapHeaders.count(
"authorization") == 0)
803 if (
mapArgs[
"-rpcpassword"].size() < 20)
809 if (mapHeaders[
"connection"] ==
"close")
817 if (!read_string(strRequest, valRequest))
823 if (valRequest.type() == obj_type) {
824 jreq.
parse(valRequest);
832 }
else if (valRequest.type() == array_type)
833 strReply = JSONRPCExecBatch(valRequest.get_array());
839 catch (Object& objError)
844 catch (std::exception& e)
852 json_spirit::Value
CRPCTable::execute(
const std::string &strMethod,
const json_spirit::Array ¶ms)
const
865 if (strWarning !=
"" && !
GetBoolArg(
"-disablesafemode",
false) &&
875 result = pcmd->
actor(params,
false);
879 result = pcmd->
actor(params,
false);
882 result = pcmd->
actor(params,
false);
884 #else // ENABLE_WALLET
887 result = pcmd->
actor(params,
false);
889 #endif // !ENABLE_WALLET
893 catch (std::exception& e)
900 return "> anoncoin-cli " + methodname +
" " + args +
"\n";
904 return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
905 "\"method\": \"" + methodname +
"\", \"params\": [" + args +
"] }' -H 'content-type: text/plain;' http://127.0.0.1:9332/\n";
const boost::filesystem::path & GetDataDir(bool fNetSpecific)
CClientUIInterface uiInterface
void SetHex(const char *psz)
json_spirit::Value setgenerate(const json_spirit::Array ¶ms, bool fHelp)
bool HTTPAuthorized(map< string, string > &mapHeaders)
json_spirit::Value signmessage(const json_spirit::Array ¶ms, bool fHelp)
Value createrawtransaction(const Array ¶ms, bool fHelp)
void RPCRunLater(const std::string &name, boost::function< void(void)> func, int64_t nSeconds)
json_spirit::Value movecmd(const json_spirit::Array ¶ms, bool fHelp)
Value stop(const Array ¶ms, bool fHelp)
json_spirit::Value walletpassphrasechange(const json_spirit::Array ¶ms, bool fHelp)
SSLIOStreamDevice< Protocol > _d
string JSONRPCReply(const Value &result, const Value &error, const Value &id)
Value help(const Array ¶ms, bool fHelp)
Anoncoin RPC command dispatcher.
iostreams::stream< SSLIOStreamDevice< Protocol > > _stream
Value addnode(const Array ¶ms, bool fHelp)
vector< unsigned char > ParseHexO(const Object &o, string strKey)
uint256 ParseHashO(const Object &o, string strKey)
asio::ssl::stream< typename Protocol::socket > sslStream
Value getblockcount(const Array ¶ms, bool fHelp)
CCriticalSection cs_wallet
Main wallet lock.
void MilliSleep(int64_t n)
bool ReadHTTPRequestLine(std::basic_istream< char > &stream, int &proto, string &http_method, string &http_uri)
Value getinfo(const Array ¶ms, bool fHelp)
std::string HelpExampleRpc(string methodname, string args)
Value sendrawtransaction(const Array ¶ms, bool fHelp)
const CRPCCommand * operator[](std::string name) const
Value importwallet(const Array ¶ms, bool fHelp)
std::string EncodeBase58(const unsigned char *pbegin, const unsigned char *pend)
Encode a byte sequence as a base58-encoded string.
string GetWarnings(string strFor)
json_spirit::Value execute(const std::string &method, const json_spirit::Array ¶ms) const
Execute a method.
Value gettxoutsetinfo(const Array ¶ms, bool fHelp)
bool MoneyRange(int64_t nValue)
bool IsHex(const string &str)
void RPCRunHandler(const boost::system::error_code &err, boost::function< void(void)> func)
Value dumpwallet(const Array ¶ms, bool fHelp)
virtual ~AcceptedConnection()
Object JSONRPCError(int code, const string &message)
Value getblockchaininfo(const Array ¶ms, bool fHelp)
Value getblock(const Array ¶ms, bool fHelp)
Value getnetworkinfo(const Array ¶ms, bool fHelp)
void RPCTypeCheck(const Array ¶ms, const list< Value_type > &typesExpected, bool fAllowNull)
virtual std::iostream & stream()
Value getdifficulty(const Array ¶ms, bool fHelp)
void ErrorReply(std::ostream &stream, const Object &objError, const Value &id)
Value decodescript(const Array ¶ms, bool fHelp)
Value importprivkey(const Array ¶ms, bool fHelp)
AcceptedConnectionImpl(asio::io_service &io_service, ssl::context &context, bool fUseSSL)
void ServiceConnection(AcceptedConnection *conn)
virtual std::string peer_address_to_string() const
virtual std::string peer_address_to_string() const =0
json_spirit::Value listunspent(const json_spirit::Array ¶ms, bool fHelp)
Value decoderawtransaction(const Array ¶ms, bool fHelp)
json_spirit::Value getunconfirmedbalance(const json_spirit::Array ¶ms, bool fHelp)
std::string HexBits(unsigned int nBits)
bool GetBoolArg(const std::string &strArg, bool fDefault)
Return boolean argument or default value.
int ReadHTTPMessage(std::basic_istream< char > &stream, map< string, string > &mapHeadersRet, string &strMessageRet, int nProto)
Value ValueFromAmount(int64_t amount)
json_spirit::Value gethashespersec(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value listreceivedbyaddress(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value getnewaddress(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value walletlock(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value settxfee(const json_spirit::Array ¶ms, bool fHelp)
Value getconnectioncount(const Array ¶ms, bool fHelp)
Value getmininginfo(const Array ¶ms, bool fHelp)
json_spirit::Value listaddressgroupings(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value sendmany(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value keypoolrefill(const json_spirit::Array ¶ms, bool fHelp)
Value getrawmempool(const Array ¶ms, bool fHelp)
Value makekeypair(const Array ¶ms, bool fHelp)
std::string help(std::string name) const
Note: This interface may still be subject to change.
string HTTPReply(int nStatus, const string &strMsg, bool keepalive)
Value submitblock(const Array ¶ms, bool fHelp)
Value getnettotals(const Array ¶ms, bool fHelp)
json_spirit::Value getgenerate(const json_spirit::Array ¶ms, bool fHelp)
Value getpeerinfo(const Array ¶ms, bool fHelp)
Value createmultisig(const Array ¶ms, bool fHelp)
Object JSONRPCReplyObj(const Value &result, const Value &error, const Value &id)
json_spirit::Value listaccounts(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value getwalletinfo(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value listsinceblock(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value encryptwallet(const json_spirit::Array ¶ms, bool fHelp)
const CChainParams & Params()
Return the currently selected parameters.
bool ClientAllowed(const boost::asio::ip::address &address)
vector< unsigned char > ParseHexV(const Value &v, string strName)
bool WildcardMatch(const char *psz, const char *mask)
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...
Value signrawtransaction(const Array ¶ms, bool fHelp)
virtual std::iostream & stream()=0
void parse(const Value &valRequest)
json_spirit::Value sendfrom(const json_spirit::Array ¶ms, bool fHelp)
int64_t AmountFromValue(const Value &value)
bool TimingResistantEqual(const T &a, const T &b)
Timing-attack-resistant comparison.
Value getaddednodeinfo(const Array ¶ms, bool fHelp)
json_spirit::Value gettransaction(const json_spirit::Array ¶ms, bool fHelp)
Value getrawtransaction(const Array ¶ms, bool fHelp)
boost::signals2::signal< bool(const std::string &message, const std::string &caption, unsigned int style), boost::signals2::last_value< bool > > ThreadSafeMessageBox
Show message box.
Value verifymessage(const Array ¶ms, bool fHelp)
Value getbestblockhash(const Array ¶ms, bool fHelp)
json_spirit::Value getreceivedbyaccount(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value listtransactions(const json_spirit::Array ¶ms, bool fHelp)
uint256 ParseHashV(const Value &v, string strName)
std::string HelpExampleCli(string methodname, string args)
Value getnetworkhashps(const Array ¶ms, bool fHelp)
std::string GetArg(const std::string &strArg, const std::string &strDefault)
Return string argument or default value.
Value getblockhash(const Array ¶ms, bool fHelp)
json_spirit::Value walletpassphrase(const json_spirit::Array ¶ms, bool fHelp)
int64_t roundint64(double d)
json_spirit::Value lockunspent(const json_spirit::Array ¶ms, bool fHelp)
Value getblocktemplate(const Array ¶ms, bool fHelp)
json_spirit::Value sendtoaddress(const json_spirit::Array ¶ms, bool fHelp)
Value gettxout(const Array ¶ms, bool fHelp)
vector< unsigned char > DecodeBase64(const char *p, bool *pfInvalid)
json_spirit::Value listreceivedbyaccount(const json_spirit::Array ¶ms, bool fHelp)
Value ping(const Array ¶ms, bool fHelp)
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
json_spirit::Value getreceivedbyaddress(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value backupwallet(const json_spirit::Array ¶ms, bool fHelp)
map< string, vector< string > > mapMultiArgs
json_spirit::Value getwork(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value addmultisigaddress(const json_spirit::Array ¶ms, bool fHelp)
Value verifychain(const Array ¶ms, bool fHelp)
json_spirit::Value getrawchangeaddress(const json_spirit::Array ¶ms, bool fHelp)
vector< unsigned char > ParseHex(const char *psz)
Value validateaddress(const Array ¶ms, bool fHelp)
json_spirit::Value listlockunspent(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value getaccount(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value(* rpcfn_type)(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value getbalance(const json_spirit::Array ¶ms, bool fHelp)
json_spirit::Value setaccount(const json_spirit::Array ¶ms, bool fHelp)
Value importaddress(const Array ¶ms, bool fHelp)
map< string, string > mapArgs
boost::filesystem::path GetConfigFile()
Value dumpprivkey(const Array ¶ms, bool fHelp)
json_spirit::Value getaddressesbyaccount(const json_spirit::Array ¶ms, bool fHelp)
void StartDummyRPCThread()
json_spirit::Value getaccountaddress(const json_spirit::Array ¶ms, bool fHelp)