Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show All 23 Lines | |||||
#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> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#include <validationinterface.h> | #include <validationinterface.h> | ||||
#ifdef ENABLE_WALLET | |||||
#include <wallet/rpcwallet.h> | |||||
#endif | |||||
#include <cstdint> | #include <cstdint> | ||||
#include <future> | #include <future> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
static void TxToJSON(const CTransaction &tx, const BlockHash &hashBlock, | static void TxToJSON(const CTransaction &tx, const BlockHash &hashBlock, | ||||
UniValue &entry) { | UniValue &entry) { | ||||
▲ Show 20 Lines • Show All 893 Lines • ▼ Show 20 Lines | if (!prevTxsUnival.isNull()) { | ||||
// produces decimal numbers that are quoted | // produces decimal numbers that are quoted | ||||
// eg getbalance returns "3.14152" rather than 3.14152 | // eg getbalance returns "3.14152" rather than 3.14152 | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Missing amount"); | throw JSONRPCError(RPC_INVALID_PARAMETER, "Missing amount"); | ||||
} | } | ||||
view.AddCoin(out, Coin(txout, 1, false), true); | view.AddCoin(out, Coin(txout, 1, false), true); | ||||
} | } | ||||
// If redeemScript given and not using the local wallet (private | // If redeemScript and private keys were given, add redeemScript to | ||||
// keys given), add redeemScript to the keystore so it can be | // the keystore so it can be signed | ||||
// signed: | |||||
if (is_temp_keystore && scriptPubKey.IsPayToScriptHash()) { | if (is_temp_keystore && scriptPubKey.IsPayToScriptHash()) { | ||||
RPCTypeCheckObj( | RPCTypeCheckObj( | ||||
prevOut, { | prevOut, { | ||||
{"redeemScript", UniValueType(UniValue::VSTR)}, | {"redeemScript", UniValueType(UniValue::VSTR)}, | ||||
}); | }); | ||||
UniValue v = find_value(prevOut, "redeemScript"); | UniValue v = find_value(prevOut, "redeemScript"); | ||||
if (!v.isNull()) { | if (!v.isNull()) { | ||||
std::vector<uint8_t> rsData(ParseHexV(v, "redeemScript")); | std::vector<uint8_t> rsData(ParseHexV(v, "redeemScript")); | ||||
▲ Show 20 Lines • Show All 1,050 Lines • Show Last 20 Lines |