Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show First 20 Lines • Show All 302 Lines • ▼ Show 20 Lines | static UniValue signmessagewithprivkey(const Config &config, | ||||
ss << strMessageMagic; | ss << strMessageMagic; | ||||
ss << strMessage; | ss << strMessage; | ||||
std::vector<uint8_t> vchSig; | std::vector<uint8_t> vchSig; | ||||
if (!key.SignCompact(ss.GetHash(), vchSig)) { | if (!key.SignCompact(ss.GetHash(), vchSig)) { | ||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Sign failed"); | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Sign failed"); | ||||
} | } | ||||
return EncodeBase64(&vchSig[0], vchSig.size()); | return EncodeBase64(vchSig.data(), vchSig.size()); | ||||
} | } | ||||
static UniValue setmocktime(const Config &config, | static UniValue setmocktime(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"setmocktime timestamp\n" | "setmocktime timestamp\n" | ||||
"\nSet the local time to given timestamp (-regtest only)\n" | "\nSet the local time to given timestamp (-regtest only)\n" | ||||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |