Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/util.cpp
Show First 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | |||||
std::string HelpExampleCli(const std::string &methodname, | std::string HelpExampleCli(const std::string &methodname, | ||||
const std::string &args) { | const std::string &args) { | ||||
return "> bitcoin-cli " + methodname + " " + args + "\n"; | return "> bitcoin-cli " + methodname + " " + args + "\n"; | ||||
} | } | ||||
std::string HelpExampleRpc(const std::string &methodname, | std::string HelpExampleRpc(const std::string &methodname, | ||||
const std::string &args) { | const std::string &args) { | ||||
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", " | return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", " | ||||
"\"id\":\"curltest\", " | "\"id\": \"curltest\", " | ||||
"\"method\": \"" + | "\"method\": \"" + | ||||
methodname + "\", \"params\": [" + args + | methodname + "\", \"params\": [" + args + | ||||
"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n"; | "]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n"; | ||||
} | } | ||||
// Converts a hex string to a public key if possible | // Converts a hex string to a public key if possible | ||||
CPubKey HexToPubKey(const std::string &hex_in) { | CPubKey HexToPubKey(const std::string &hex_in) { | ||||
if (!IsHex(hex_in)) { | if (!IsHex(hex_in)) { | ||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | ||||
"Invalid public key: " + hex_in); | "Invalid public key: " + hex_in); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 736 Lines • Show Last 20 Lines |