Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show All 10 Lines | |||||
#include "core_io.h" | #include "core_io.h" | ||||
#include "dstencode.h" | #include "dstencode.h" | ||||
#include "net.h" | #include "net.h" | ||||
#include "policy/fees.h" | #include "policy/fees.h" | ||||
#include "policy/policy.h" | #include "policy/policy.h" | ||||
#include "rpc/mining.h" | #include "rpc/mining.h" | ||||
#include "rpc/misc.h" | #include "rpc/misc.h" | ||||
#include "rpc/rawtransaction.h" | #include "rpc/rawtransaction.h" | ||||
#include "rpc/safemode.h" | |||||
#include "rpc/server.h" | #include "rpc/server.h" | ||||
#include "timedata.h" | #include "timedata.h" | ||||
#include "util.h" | #include "util.h" | ||||
#include "utilmoneystr.h" | #include "utilmoneystr.h" | ||||
#include "validation.h" | #include "validation.h" | ||||
#include "wallet/coincontrol.h" | #include "wallet/coincontrol.h" | ||||
#include "wallet/wallet.h" | #include "wallet/wallet.h" | ||||
#include "wallet/walletdb.h" | #include "wallet/walletdb.h" | ||||
▲ Show 20 Lines • Show All 500 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
HelpExampleCli( | HelpExampleCli( | ||||
"sendtoaddress", | "sendtoaddress", | ||||
"\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"\" \"\" true") + | "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" 0.1 \"\" \"\" true") + | ||||
HelpExampleRpc("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvay" | HelpExampleRpc("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvay" | ||||
"dd\", 0.1, \"donation\", \"seans " | "dd\", 0.1, \"donation\", \"seans " | ||||
"outpost\"")); | "outpost\"")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
CTxDestination dest = | CTxDestination dest = | ||||
DecodeDestination(request.params[0].get_str(), config.GetChainParams()); | DecodeDestination(request.params[0].get_str(), config.GetChainParams()); | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 0) { | ||||
" ]\n" | " ]\n" | ||||
" ,...\n" | " ,...\n" | ||||
"]\n" | "]\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("listaddressgroupings", "") + | HelpExampleCli("listaddressgroupings", "") + | ||||
HelpExampleRpc("listaddressgroupings", "")); | HelpExampleRpc("listaddressgroupings", "")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
UniValue jsonGroupings(UniValue::VARR); | UniValue jsonGroupings(UniValue::VARR); | ||||
std::map<CTxDestination, Amount> balances = pwallet->GetAddressBalances(); | std::map<CTxDestination, Amount> balances = pwallet->GetAddressBalances(); | ||||
▲ Show 20 Lines • Show All 124 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"\nThe amount with at least 6 confirmations\n" + | "\nThe amount with at least 6 confirmations\n" + | ||||
HelpExampleCli("getreceivedbyaddress", | HelpExampleCli("getreceivedbyaddress", | ||||
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" 6") + | "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" 6") + | ||||
"\nAs a json rpc call\n" + | "\nAs a json rpc call\n" + | ||||
HelpExampleRpc("getreceivedbyaddress", | HelpExampleRpc("getreceivedbyaddress", | ||||
"\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", 6")); | "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", 6")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
// Bitcoin address | // Bitcoin address | ||||
CTxDestination dest = | CTxDestination dest = | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
"\nAmount received at the tabby label including unconfirmed " | "\nAmount received at the tabby label including unconfirmed " | ||||
"amounts with zero confirmations\n" + | "amounts with zero confirmations\n" + | ||||
HelpExampleCli("getreceivedbylabel", "\"tabby\" 0") + | HelpExampleCli("getreceivedbylabel", "\"tabby\" 0") + | ||||
"\nThe amount with at least 6 confirmations\n" + | "\nThe amount with at least 6 confirmations\n" + | ||||
HelpExampleCli("getreceivedbylabel", "\"tabby\" 6") + | HelpExampleCli("getreceivedbylabel", "\"tabby\" 6") + | ||||
"\nAs a json rpc call\n" + | "\nAs a json rpc call\n" + | ||||
HelpExampleRpc("getreceivedbylabel", "\"tabby\", 6")); | HelpExampleRpc("getreceivedbylabel", "\"tabby\", 6")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
// Minimum confirmations | // Minimum confirmations | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 3) { | ||||
"\nExamples:\n" | "\nExamples:\n" | ||||
"\nThe total amount in the wallet with 1 or more confirmations\n" + | "\nThe total amount in the wallet with 1 or more confirmations\n" + | ||||
HelpExampleCli("getbalance", "") + | HelpExampleCli("getbalance", "") + | ||||
"\nThe total amount in the wallet at least 6 blocks confirmed\n" + | "\nThe total amount in the wallet at least 6 blocks confirmed\n" + | ||||
HelpExampleCli("getbalance", "\"*\" 6") + "\nAs a json rpc call\n" + | HelpExampleCli("getbalance", "\"*\" 6") + "\nAs a json rpc call\n" + | ||||
HelpExampleRpc("getbalance", "\"*\", 6")); | HelpExampleRpc("getbalance", "\"*\", 6")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
if (request.params.size() == 0) { | if (request.params.size() == 0) { | ||||
return ValueFromAmount(pwallet->GetBalance()); | return ValueFromAmount(pwallet->GetBalance()); | ||||
Show All 25 Lines | static UniValue getunconfirmedbalance(const Config &config, | ||||
} | } | ||||
if (request.fHelp || request.params.size() > 0) { | if (request.fHelp || request.params.size() > 0) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"getunconfirmedbalance\n" | "getunconfirmedbalance\n" | ||||
"Returns the server's total unconfirmed balance\n"); | "Returns the server's total unconfirmed balance\n"); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
return ValueFromAmount(pwallet->GetUnconfirmedBalance()); | return ValueFromAmount(pwallet->GetUnconfirmedBalance()); | ||||
} | } | ||||
Show All 36 Lines | if (request.fHelp || request.params.size() < 3 || | ||||
HelpExampleCli("move", | HelpExampleCli("move", | ||||
"\"timotei\" \"akiko\" 0.01 6 \"happy birthday!\"") + | "\"timotei\" \"akiko\" 0.01 6 \"happy birthday!\"") + | ||||
"\nAs a json rpc call\n" + | "\nAs a json rpc call\n" + | ||||
HelpExampleRpc( | HelpExampleRpc( | ||||
"move", | "move", | ||||
"\"timotei\", \"akiko\", 0.01, 6, \"happy birthday!\"")); | "\"timotei\", \"akiko\", 0.01, 6, \"happy birthday!\"")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
std::string strFrom = LabelFromValue(request.params[0]); | std::string strFrom = LabelFromValue(request.params[0]); | ||||
std::string strTo = LabelFromValue(request.params[1]); | std::string strTo = LabelFromValue(request.params[1]); | ||||
Amount nAmount = AmountFromValue(request.params[2]); | Amount nAmount = AmountFromValue(request.params[2]); | ||||
if (nAmount <= Amount::zero()) { | if (nAmount <= Amount::zero()) { | ||||
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for send"); | throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount for send"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 3 || | ||||
"\"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" " | "\"tabby\" \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\" " | ||||
"0.01 6 \"donation\" \"seans outpost\"") + | "0.01 6 \"donation\" \"seans outpost\"") + | ||||
"\nAs a json rpc call\n" + | "\nAs a json rpc call\n" + | ||||
HelpExampleRpc("sendfrom", | HelpExampleRpc("sendfrom", | ||||
"\"tabby\", \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", " | "\"tabby\", \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", " | ||||
"0.01, 6, \"donation\", \"seans outpost\"")); | "0.01, 6, \"donation\", \"seans outpost\"")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
std::string label = LabelFromValue(request.params[0]); | std::string label = LabelFromValue(request.params[0]); | ||||
CTxDestination dest = | CTxDestination dest = | ||||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 2 || | ||||
"\nAs a json rpc call\n" + | "\nAs a json rpc call\n" + | ||||
HelpExampleRpc("sendmany", | HelpExampleRpc("sendmany", | ||||
"\"\", " | "\"\", " | ||||
"\"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01," | "\"{\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01," | ||||
"\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\"," | "\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}\"," | ||||
" 6, \"testing\"")); | " 6, \"testing\"")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
if (pwallet->GetBroadcastTransactions() && !g_connman) { | if (pwallet->GetBroadcastTransactions() && !g_connman) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
▲ Show 20 Lines • Show All 374 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 4) { | ||||
HelpExampleCli("listreceivedbyaddress", "") + | HelpExampleCli("listreceivedbyaddress", "") + | ||||
HelpExampleCli("listreceivedbyaddress", "6 true") + | HelpExampleCli("listreceivedbyaddress", "6 true") + | ||||
HelpExampleRpc("listreceivedbyaddress", "6, true, true") + | HelpExampleRpc("listreceivedbyaddress", "6, true, true") + | ||||
HelpExampleRpc( | HelpExampleRpc( | ||||
"listreceivedbyaddress", | "listreceivedbyaddress", | ||||
"6, true, true, \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\"")); | "6, true, true, \"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\"")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
return ListReceived(config, pwallet, request.params, false); | return ListReceived(config, pwallet, request.params, false); | ||||
} | } | ||||
Show All 34 Lines | if (request.fHelp || request.params.size() > 3) { | ||||
"]\n" | "]\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("listreceivedbylabel", "") + | HelpExampleCli("listreceivedbylabel", "") + | ||||
HelpExampleCli("listreceivedbylabel", "6 true") + | HelpExampleCli("listreceivedbylabel", "6 true") + | ||||
HelpExampleRpc("listreceivedbylabel", "6, true, true")); | HelpExampleRpc("listreceivedbylabel", "6, true, true")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
return ListReceived(config, pwallet, request.params, true); | return ListReceived(config, pwallet, request.params, true); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 4) { | ||||
"\nList the most recent 10 transactions in the systems\n" + | "\nList the most recent 10 transactions in the systems\n" + | ||||
HelpExampleCli("listtransactions", "") + | HelpExampleCli("listtransactions", "") + | ||||
"\nList transactions 100 to 120\n" + | "\nList transactions 100 to 120\n" + | ||||
HelpExampleCli("listtransactions", "\"*\" 20 100") + | HelpExampleCli("listtransactions", "\"*\" 20 100") + | ||||
"\nAs a json rpc call\n" + | "\nAs a json rpc call\n" + | ||||
HelpExampleRpc("listtransactions", "\"*\", 20, 100")); | HelpExampleRpc("listtransactions", "\"*\", 20, 100")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
std::string strAccount = "*"; | std::string strAccount = "*"; | ||||
if (!request.params[0].isNull()) { | if (!request.params[0].isNull()) { | ||||
▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 2) { | ||||
"\nList account balances including zero confirmation " | "\nList account balances including zero confirmation " | ||||
"transactions\n" + | "transactions\n" + | ||||
HelpExampleCli("listaccounts", "0") + | HelpExampleCli("listaccounts", "0") + | ||||
"\nList account balances for 6 or more confirmations\n" + | "\nList account balances for 6 or more confirmations\n" + | ||||
HelpExampleCli("listaccounts", "6") + "\nAs json rpc call\n" + | HelpExampleCli("listaccounts", "6") + "\nAs json rpc call\n" + | ||||
HelpExampleRpc("listaccounts", "6")); | HelpExampleRpc("listaccounts", "6")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
int nMinDepth = 1; | int nMinDepth = 1; | ||||
if (request.params.size() > 0) { | if (request.params.size() > 0) { | ||||
▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 4) { | ||||
HelpExampleCli("listsinceblock", "\"000000000000000bacf66f7497b7dc4" | HelpExampleCli("listsinceblock", "\"000000000000000bacf66f7497b7dc4" | ||||
"5ef753ee9a7d38571037cdb1a57f663ad" | "5ef753ee9a7d38571037cdb1a57f663ad" | ||||
"\" 6") + | "\" 6") + | ||||
HelpExampleRpc("listsinceblock", "\"000000000000000bacf66f7497b7dc4" | HelpExampleRpc("listsinceblock", "\"000000000000000bacf66f7497b7dc4" | ||||
"5ef753ee9a7d38571037cdb1a57f663ad" | "5ef753ee9a7d38571037cdb1a57f663ad" | ||||
"\", 6")); | "\", 6")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
// Block index of the specified block or the common ancestor, if the block | // Block index of the specified block or the common ancestor, if the block | ||||
// provided was in a deactivated chain. | // provided was in a deactivated chain. | ||||
▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() < 1 || | ||||
HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e211" | HelpExampleCli("gettransaction", "\"1075db55d416d3ca199f55b6084e211" | ||||
"5b9345e16c5cf302fc80e9d5fbf5d48d" | "5b9345e16c5cf302fc80e9d5fbf5d48d" | ||||
"\" true") + | "\" true") + | ||||
HelpExampleRpc("gettransaction", "\"1075db55d416d3ca199f55b6084e211" | HelpExampleRpc("gettransaction", "\"1075db55d416d3ca199f55b6084e211" | ||||
"5b9345e16c5cf302fc80e9d5fbf5d48d" | "5b9345e16c5cf302fc80e9d5fbf5d48d" | ||||
"\"")); | "\"")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
TxId txid; | TxId txid; | ||||
txid.SetHex(request.params[0].get_str()); | txid.SetHex(request.params[0].get_str()); | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 1) { | ||||
HelpExampleCli("abandontransaction", "\"1075db55d416d3ca199f55b6084" | HelpExampleCli("abandontransaction", "\"1075db55d416d3ca199f55b6084" | ||||
"e2115b9345e16c5cf302fc80e9d5f" | "e2115b9345e16c5cf302fc80e9d5f" | ||||
"bf5d48d\"") + | "bf5d48d\"") + | ||||
HelpExampleRpc("abandontransaction", "\"1075db55d416d3ca199f55b6084" | HelpExampleRpc("abandontransaction", "\"1075db55d416d3ca199f55b6084" | ||||
"e2115b9345e16c5cf302fc80e9d5f" | "e2115b9345e16c5cf302fc80e9d5f" | ||||
"bf5d48d\"")); | "bf5d48d\"")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
TxId txid; | TxId txid; | ||||
txid.SetHex(request.params[0].get_str()); | txid.SetHex(request.params[0].get_str()); | ||||
▲ Show 20 Lines • Show All 514 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 0) { | ||||
HelpExampleCli("lockunspent", "true " | HelpExampleCli("lockunspent", "true " | ||||
"\"[{\\\"txid\\\":" | "\"[{\\\"txid\\\":" | ||||
"\\\"a08e6907dbbd3d809776dbfc5d82e371" | "\\\"a08e6907dbbd3d809776dbfc5d82e371" | ||||
"b764ed838b5655e72f463568df1aadf0\\\"" | "b764ed838b5655e72f463568df1aadf0\\\"" | ||||
",\\\"vout\\\":1}]\"") + | ",\\\"vout\\\":1}]\"") + | ||||
"\nAs a json rpc call\n" + HelpExampleRpc("listlockunspent", "")); | "\nAs a json rpc call\n" + HelpExampleRpc("listlockunspent", "")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
std::vector<COutPoint> vOutpts; | std::vector<COutPoint> vOutpts; | ||||
pwallet->ListLockedCoins(vOutpts); | pwallet->ListLockedCoins(vOutpts); | ||||
UniValue ret(UniValue::VARR); | UniValue ret(UniValue::VARR); | ||||
for (COutPoint &output : vOutpts) { | for (COutPoint &output : vOutpts) { | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 0) { | ||||
" \"hdmasterkeyid\": \"<hash160>\" (string) " | " \"hdmasterkeyid\": \"<hash160>\" (string) " | ||||
"the Hash160 of the HD master pubkey\n" | "the Hash160 of the HD master pubkey\n" | ||||
"}\n" | "}\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("getwalletinfo", "") + | HelpExampleCli("getwalletinfo", "") + | ||||
HelpExampleRpc("getwalletinfo", "")); | HelpExampleRpc("getwalletinfo", "")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
LOCK2(cs_main, pwallet->cs_wallet); | LOCK2(cs_main, pwallet->cs_wallet); | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() > 5) { | ||||
HelpExampleCli( | HelpExampleCli( | ||||
"listunspent", | "listunspent", | ||||
"6 9999999 '[]' true '{ \"minimumAmount\": 0.005 }'") + | "6 9999999 '[]' true '{ \"minimumAmount\": 0.005 }'") + | ||||
HelpExampleRpc( | HelpExampleRpc( | ||||
"listunspent", | "listunspent", | ||||
"6, 9999999, [] , true, { \"minimumAmount\": 0.005 } ")); | "6, 9999999, [] , true, { \"minimumAmount\": 0.005 } ")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
int nMinDepth = 1; | int nMinDepth = 1; | ||||
if (request.params.size() > 0 && !request.params[0].isNull()) { | if (request.params.size() > 0 && !request.params[0].isNull()) { | ||||
RPCTypeCheckArgument(request.params[0], UniValue::VNUM); | RPCTypeCheckArgument(request.params[0], UniValue::VNUM); | ||||
nMinDepth = request.params[0].get_int(); | nMinDepth = request.params[0].get_int(); | ||||
} | } | ||||
int nMaxDepth = 9999999; | int nMaxDepth = 9999999; | ||||
if (request.params.size() > 1 && !request.params[1].isNull()) { | if (request.params.size() > 1 && !request.params[1].isNull()) { | ||||
▲ Show 20 Lines • Show All 193 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\"")); | ||||
} | } | ||||
ObserveSafeMode(); | |||||
RPCTypeCheck(request.params, {UniValue::VSTR}); | RPCTypeCheck(request.params, {UniValue::VSTR}); | ||||
// Make sure the results are valid at least up to the most recent block | // Make sure the results are valid at least up to the most recent block | ||||
// the user could have gotten from another RPC command prior to now | // the user could have gotten from another RPC command prior to now | ||||
pwallet->BlockUntilSyncedToCurrentChain(); | pwallet->BlockUntilSyncedToCurrentChain(); | ||||
CCoinControl coinControl; | CCoinControl coinControl; | ||||
int changePosition = -1; | int changePosition = -1; | ||||
▲ Show 20 Lines • Show All 410 Lines • Show Last 20 Lines |