aboutsummaryrefslogtreecommitdiff
path: root/src/rpcserver.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-06-05 07:00:57 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-06-05 07:11:44 +0200
commit3fce72eaa3ea75aa911e32c4d96313848338cede (patch)
tree8604bec497a9137315589e468ba8f79e1f7a0fd7 /src/rpcserver.cpp
parentd38cd47fe3d65d3d6d867d6fb61a4ce24f0747b3 (diff)
parenta9ac95c1bc67726a7d6eecb35d7650eed6c89361 (diff)
Merge pull request #6206
a9ac95c use const references where appropriate (Philip Kaufmann)
Diffstat (limited to 'src/rpcserver.cpp')
-rw-r--r--src/rpcserver.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp
index a92ec0b29b..e6bf008618 100644
--- a/src/rpcserver.cpp
+++ b/src/rpcserver.cpp
@@ -173,7 +173,7 @@ vector<unsigned char> ParseHexO(const UniValue& o, string strKey)
* Note: This interface may still be subject to change.
*/
-string CRPCTable::help(string strCommand) const
+std::string CRPCTable::help(const std::string& strCommand) const
{
string strRet;
string category;
@@ -391,7 +391,7 @@ CRPCTable::CRPCTable()
}
}
-const CRPCCommand *CRPCTable::operator[](string name) const
+const CRPCCommand *CRPCTable::operator[](const std::string& name) const
{
map<string, const CRPCCommand*>::const_iterator it = mapCommands.find(name);
if (it == mapCommands.end())
@@ -1026,11 +1026,13 @@ UniValue CRPCTable::execute(const std::string &strMethod, const UniValue &params
g_rpcSignals.PostCommand(*pcmd);
}
-std::string HelpExampleCli(string methodname, string args){
+std::string HelpExampleCli(const std::string& methodname, const std::string& args)
+{
return "> bitcoin-cli " + methodname + " " + args + "\n";
}
-std::string HelpExampleRpc(string methodname, string args){
+std::string HelpExampleRpc(const std::string& methodname, const std::string& args)
+{
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", "
"\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
}