Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show All 11 Lines | |||||
#include "core_io.h" | #include "core_io.h" | ||||
#include "dstencode.h" | #include "dstencode.h" | ||||
#include "init.h" | #include "init.h" | ||||
#include "keystore.h" | #include "keystore.h" | ||||
#include "merkleblock.h" | #include "merkleblock.h" | ||||
#include "net.h" | #include "net.h" | ||||
#include "policy/policy.h" | #include "policy/policy.h" | ||||
#include "primitives/transaction.h" | #include "primitives/transaction.h" | ||||
#include "rpc/safemode.h" | |||||
#include "rpc/server.h" | #include "rpc/server.h" | ||||
#include "rpc/tojson.h" | #include "rpc/tojson.h" | ||||
#include "script/script.h" | #include "script/script.h" | ||||
#include "script/script_error.h" | #include "script/script_error.h" | ||||
#include "script/sign.h" | #include "script/sign.h" | ||||
#include "script/standard.h" | #include "script/standard.h" | ||||
#include "txmempool.h" | #include "txmempool.h" | ||||
#include "uint256.h" | #include "uint256.h" | ||||
▲ Show 20 Lines • Show All 1,232 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"Sign the transaction, and get back the hex\n" + | "Sign the transaction, and get back the hex\n" + | ||||
HelpExampleCli("signrawtransaction", "\"myhex\"") + | HelpExampleCli("signrawtransaction", "\"myhex\"") + | ||||
"\nSend the transaction (signed hex)\n" + | "\nSend the transaction (signed hex)\n" + | ||||
HelpExampleCli("sendrawtransaction", "\"signedhex\"") + | HelpExampleCli("sendrawtransaction", "\"signedhex\"") + | ||||
"\nAs a json rpc call\n" + | "\nAs a json rpc call\n" + | ||||
HelpExampleRpc("sendrawtransaction", "\"signedhex\"")); | HelpExampleRpc("sendrawtransaction", "\"signedhex\"")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
LOCK(cs_main); | LOCK(cs_main); | ||||
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VBOOL}); | RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VBOOL}); | ||||
// parse hex string from parameter | // parse hex string from parameter | ||||
CMutableTransaction mtx; | CMutableTransaction mtx; | ||||
if (!DecodeHexTx(mtx, request.params[0].get_str())) { | if (!DecodeHexTx(mtx, request.params[0].get_str())) { | ||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); | throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |