Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show All 17 Lines | |||||
#include "util.h" | #include "util.h" | ||||
#include "utilmoneystr.h" | #include "utilmoneystr.h" | ||||
#include "validation.h" | #include "validation.h" | ||||
#include "wallet.h" | #include "wallet.h" | ||||
#include "walletdb.h" | #include "walletdb.h" | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <boost/assign/list_of.hpp> | |||||
#include <univalue.h> | #include <univalue.h> | ||||
int64_t nWalletUnlockTime; | int64_t nWalletUnlockTime; | ||||
static CCriticalSection cs_nWalletUnlockTime; | static CCriticalSection cs_nWalletUnlockTime; | ||||
std::string HelpRequiringPassphrase() { | std::string HelpRequiringPassphrase() { | ||||
return pwalletMain && pwalletMain->IsCrypted() | return pwalletMain && pwalletMain->IsCrypted() | ||||
? "\nRequires wallet passphrase to be set with walletpassphrase " | ? "\nRequires wallet passphrase to be set with walletpassphrase " | ||||
▲ Show 20 Lines • Show All 2,676 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"\\\"a08e6907dbbd3d809776dbfc5d82e371" | "\\\"a08e6907dbbd3d809776dbfc5d82e371" | ||||
"b764ed838b5655e72f463568df1aadf0\\\"" | "b764ed838b5655e72f463568df1aadf0\\\"" | ||||
",\\\"vout\\\":1}]\"")); | ",\\\"vout\\\":1}]\"")); | ||||
} | } | ||||
LOCK2(cs_main, pwalletMain->cs_wallet); | LOCK2(cs_main, pwalletMain->cs_wallet); | ||||
if (request.params.size() == 1) { | if (request.params.size() == 1) { | ||||
RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VBOOL)); | RPCTypeCheck(request.params, {UniValue::VBOOL}); | ||||
} else { | } else { | ||||
RPCTypeCheck(request.params, | RPCTypeCheck(request.params, {UniValue::VBOOL, UniValue::VARR}); | ||||
boost::assign::list_of(UniValue::VBOOL)(UniValue::VARR)); | |||||
} | } | ||||
bool fUnlock = request.params[0].get_bool(); | bool fUnlock = request.params[0].get_bool(); | ||||
if (request.params.size() == 1) { | if (request.params.size() == 1) { | ||||
if (fUnlock) { | if (fUnlock) { | ||||
pwalletMain->UnlockAllCoins(); | pwalletMain->UnlockAllCoins(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 478 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"\nAdd sufficient unsigned inputs to meet the output value\n" + | "\nAdd sufficient unsigned inputs to meet the output value\n" + | ||||
HelpExampleCli("fundrawtransaction", "\"rawtransactionhex\"") + | HelpExampleCli("fundrawtransaction", "\"rawtransactionhex\"") + | ||||
"\nSign the transaction\n" + | "\nSign the transaction\n" + | ||||
HelpExampleCli("signrawtransaction", "\"fundedtransactionhex\"") + | HelpExampleCli("signrawtransaction", "\"fundedtransactionhex\"") + | ||||
"\nSend the transaction\n" + | "\nSend the transaction\n" + | ||||
HelpExampleCli("sendrawtransaction", "\"signedtransactionhex\"")); | HelpExampleCli("sendrawtransaction", "\"signedtransactionhex\"")); | ||||
} | } | ||||
RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VSTR)); | RPCTypeCheck(request.params, {UniValue::VSTR}); | ||||
CTxDestination changeAddress = CNoDestination(); | CTxDestination changeAddress = CNoDestination(); | ||||
int changePosition = -1; | int changePosition = -1; | ||||
bool includeWatching = false; | bool includeWatching = false; | ||||
bool lockUnspents = false; | bool lockUnspents = false; | ||||
bool reserveChangeKey = true; | bool reserveChangeKey = true; | ||||
CFeeRate feeRate = CFeeRate(0); | CFeeRate feeRate = CFeeRate(0); | ||||
bool overrideEstimatedFeerate = false; | bool overrideEstimatedFeerate = false; | ||||
UniValue subtractFeeFromOutputs; | UniValue subtractFeeFromOutputs; | ||||
std::set<int> setSubtractFeeFromOutputs; | std::set<int> setSubtractFeeFromOutputs; | ||||
if (request.params.size() > 1) { | if (request.params.size() > 1) { | ||||
if (request.params[1].type() == UniValue::VBOOL) { | if (request.params[1].type() == UniValue::VBOOL) { | ||||
// backward compatibility bool only fallback | // backward compatibility bool only fallback | ||||
includeWatching = request.params[1].get_bool(); | includeWatching = request.params[1].get_bool(); | ||||
} else { | } else { | ||||
RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VSTR)( | RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VOBJ}); | ||||
UniValue::VOBJ)); | |||||
UniValue options = request.params[1]; | UniValue options = request.params[1]; | ||||
RPCTypeCheckObj( | RPCTypeCheckObj( | ||||
options, | options, | ||||
{ | { | ||||
{"changeAddress", UniValueType(UniValue::VSTR)}, | {"changeAddress", UniValueType(UniValue::VSTR)}, | ||||
{"changePosition", UniValueType(UniValue::VNUM)}, | {"changePosition", UniValueType(UniValue::VNUM)}, | ||||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |