Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 1,246 Lines • ▼ Show 20 Lines | #endif | ||||
if (!request.params[2].isNull()) { | if (!request.params[2].isNull()) { | ||||
new_request.params.push_back(request.params[0]); | new_request.params.push_back(request.params[0]); | ||||
// Note: the prevtxs and privkeys are reversed for | // Note: the prevtxs and privkeys are reversed for | ||||
// signrawtransactionwithkey | // signrawtransactionwithkey | ||||
new_request.params.push_back(request.params[2]); | new_request.params.push_back(request.params[2]); | ||||
new_request.params.push_back(request.params[1]); | new_request.params.push_back(request.params[1]); | ||||
new_request.params.push_back(request.params[3]); | new_request.params.push_back(request.params[3]); | ||||
return signrawtransactionwithkey(config, new_request); | return signrawtransactionwithkey(config, new_request); | ||||
} | } else { | ||||
// Otherwise sign with the wallet which does not take a privkeys parameter | |||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
else { | // Otherwise sign with the wallet which does not take a privkeys | ||||
// parameter | |||||
new_request.params.push_back(request.params[0]); | new_request.params.push_back(request.params[0]); | ||||
new_request.params.push_back(request.params[1]); | new_request.params.push_back(request.params[1]); | ||||
new_request.params.push_back(request.params[3]); | new_request.params.push_back(request.params[3]); | ||||
return signrawtransactionwithwallet(config, new_request); | return signrawtransactionwithwallet(config, new_request); | ||||
} | #else | ||||
#endif | // If we have made it this far, then wallet is disabled and no private | ||||
// If we have made it this far, then wallet is disabled and no private keys | // keys were given, so fail here. | ||||
// were given, so fail here. | |||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "No private keys available."); | throw JSONRPCError(RPC_INVALID_PARAMETER, "No private keys available."); | ||||
#endif | |||||
} | |||||
} | } | ||||
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( | throw std::runtime_error( | ||||
"sendrawtransaction \"hexstring\" ( allowhighfees )\n" | "sendrawtransaction \"hexstring\" ( allowhighfees )\n" | ||||
▲ Show 20 Lines • Show All 216 Lines • Show Last 20 Lines |