Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 0) { | ||||
"pool\n" | "pool\n" | ||||
" \"keypoolsize\": xxxx, (numeric) how many new keys are " | " \"keypoolsize\": xxxx, (numeric) how many new keys are " | ||||
"pre-generated\n" | "pre-generated\n" | ||||
" \"unlocked_until\": ttt, (numeric) the timestamp in " | " \"unlocked_until\": ttt, (numeric) the timestamp in " | ||||
"seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is " | "seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is " | ||||
"unlocked for transfers, or 0 if the wallet is locked\n" | "unlocked for transfers, or 0 if the wallet is locked\n" | ||||
" \"paytxfee\": x.xxxx, (numeric) the transaction fee set " | " \"paytxfee\": x.xxxx, (numeric) the transaction fee set " | ||||
"in " + | "in " + | ||||
CURRENCY_UNIT + "/kB\n" | CURRENCY_UNIT + | ||||
" \"relayfee\": x.xxxx, (numeric) minimum " | "/kB\n" | ||||
"relay fee for non-free transactions in " + | " \"relayfee\": x.xxxx, (numeric) minimum relay fee for " | ||||
"non-free transactions in " + | |||||
CURRENCY_UNIT + | CURRENCY_UNIT + | ||||
"/kB\n" | "/kB\n" | ||||
" \"errors\": \"...\" (string) any error messages\n" | " \"errors\": \"...\" (string) any error messages\n" | ||||
"}\n" | "}\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("getinfo", "") + HelpExampleRpc("getinfo", "")); | HelpExampleCli("getinfo", "") + HelpExampleRpc("getinfo", "")); | ||||
} | } | ||||
Show All 21 Lines | #endif | ||||
obj.pushKV("timeoffset", GetTimeOffset()); | obj.pushKV("timeoffset", GetTimeOffset()); | ||||
if (g_connman) { | if (g_connman) { | ||||
obj.pushKV("connections", | obj.pushKV("connections", | ||||
(int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL)); | (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL)); | ||||
} | } | ||||
obj.pushKV("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() | obj.pushKV("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() | ||||
: std::string())); | : std::string())); | ||||
obj.pushKV("difficulty", double(GetDifficulty(chainActive.Tip()))); | obj.pushKV("difficulty", double(GetDifficulty(chainActive.Tip()))); | ||||
obj.pushKV("testnet", | obj.pushKV("testnet", config.GetChainParams().NetworkIDString() == | ||||
config.GetChainParams().NetworkIDString() == | |||||
CBaseChainParams::TESTNET); | CBaseChainParams::TESTNET); | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
if (pwallet) { | if (pwallet) { | ||||
obj.pushKV("keypoololdest", pwallet->GetOldestKeyPoolTime()); | obj.pushKV("keypoololdest", pwallet->GetOldestKeyPoolTime()); | ||||
obj.pushKV("keypoolsize", (int)pwallet->GetKeyPoolSize()); | obj.pushKV("keypoolsize", (int)pwallet->GetKeyPoolSize()); | ||||
} | } | ||||
if (pwallet && pwallet->IsCrypted()) { | if (pwallet && pwallet->IsCrypted()) { | ||||
obj.pushKV("unlocked_until", pwallet->nRelockTime); | obj.pushKV("unlocked_until", pwallet->nRelockTime); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 372 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 2) { | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nCreate the signature\n" + | "\nCreate the signature\n" + | ||||
HelpExampleCli("signmessagewithprivkey", | HelpExampleCli("signmessagewithprivkey", | ||||
"\"privkey\" \"my message\"") + | "\"privkey\" \"my message\"") + | ||||
"\nVerify the signature\n" + | "\nVerify the signature\n" + | ||||
HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4" | HelpExampleCli("verifymessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4" | ||||
"XX\" \"signature\" \"my " | "XX\" \"signature\" \"my " | ||||
"message\"") + | "message\"") + | ||||
"\nAs json rpc\n" + HelpExampleRpc("signmessagewithprivkey", | "\nAs json rpc\n" + | ||||
HelpExampleRpc("signmessagewithprivkey", | |||||
"\"privkey\", \"my message\"")); | "\"privkey\", \"my message\"")); | ||||
} | } | ||||
std::string strPrivkey = request.params[0].get_str(); | std::string strPrivkey = request.params[0].get_str(); | ||||
std::string strMessage = request.params[1].get_str(); | std::string strMessage = request.params[1].get_str(); | ||||
CBitcoinSecret vchSecret; | CBitcoinSecret vchSecret; | ||||
bool fGood = vchSecret.SetString(strPrivkey); | bool fGood = vchSecret.SetString(strPrivkey); | ||||
if (!fGood) { | if (!fGood) { | ||||
▲ Show 20 Lines • Show All 176 Lines • Show Last 20 Lines |