Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 902 Lines • ▼ Show 20 Lines | for (size_t idx = 0; idx < keys.size(); ++idx) { | ||||
CKey key = DecodeSecret(k.get_str()); | CKey key = DecodeSecret(k.get_str()); | ||||
if (!key.IsValid()) { | if (!key.IsValid()) { | ||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | ||||
"Invalid private key"); | "Invalid private key"); | ||||
} | } | ||||
keystore.AddKey(key); | keystore.AddKey(key); | ||||
} | } | ||||
return SignTransaction(*g_rpc_interfaces->chain, mtx, request.params[2], | return SignTransaction(*g_rpc_node->chain, mtx, request.params[2], | ||||
&keystore, true, request.params[3]); | &keystore, true, request.params[3]); | ||||
} | } | ||||
static UniValue sendrawtransaction(const Config &config, | static UniValue sendrawtransaction(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() < 1 || | if (request.fHelp || request.params.size() < 1 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
throw std::runtime_error(RPCHelpMan{ | throw std::runtime_error(RPCHelpMan{ | ||||
▲ Show 20 Lines • Show All 1,061 Lines • Show Last 20 Lines |