Skip to content

Commit ea9e82d

Browse files
committed
[squashme] fix listunspent code indentation
1 parent b9fb692 commit ea9e82d

File tree

1 file changed

+53
-53
lines changed

1 file changed

+53
-53
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2239,82 +2239,82 @@ Value listunspent(const Array& params, bool fHelp)
22392239
return Value::null;
22402240

22412241
if (fHelp || params.size() > 3)
2242-
throw runtime_error(
2243-
"listunspent ( minconf maxconf [\"address\",...] )\n"
2244-
"\nReturns array of unspent transaction outputs\n"
2245-
"with between minconf and maxconf (inclusive) confirmations.\n"
2246-
"Optionally filter to only include txouts paid to specified addresses.\n"
2247-
"Results are an array of Objects, each of which has:\n"
2248-
"{txid, vout, scriptPubKey, amount, confirmations}\n"
2249-
"\nArguments:\n"
2250-
"1. minconf (numeric, optional, default=1) The minimum confirmations to filter\n"
2251-
"2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter\n"
2252-
"3. \"addresses\" (string) A json array of bitcoin addresses to filter\n"
2253-
" [\n"
2254-
" \"address\" (string) bitcoin address\n"
2255-
" ,...\n"
2256-
" ]\n"
2257-
"\nResult\n"
2258-
"[ (array of json object)\n"
2259-
" {\n"
2260-
" \"txid\" : \"txid\", (string) the transaction id \n"
2261-
" \"vout\" : n, (numeric) the vout value\n"
2262-
" \"address\" : \"address\", (string) the bitcoin address\n"
2263-
" \"account\" : \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account\n"
2264-
" \"scriptPubKey\" : \"key\", (string) the script key\n"
2265-
" \"amount\" : x.xxx, (numeric) the transaction amount in btc\n"
2266-
" \"confirmations\" : n (numeric) The number of confirmations\n"
2267-
" }\n"
2268-
" ,...\n"
2269-
"]\n"
2270-
2271-
"\nExamples\n"
2272-
+ HelpExampleCli("listunspent", "")
2273-
+ HelpExampleCli("listunspent", "6 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
2274-
+ HelpExampleRpc("listunspent", "6, 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
2275-
);
2276-
2242+
throw runtime_error(
2243+
"listunspent ( minconf maxconf [\"address\",...] )\n"
2244+
"\nReturns array of unspent transaction outputs\n"
2245+
"with between minconf and maxconf (inclusive) confirmations.\n"
2246+
"Optionally filter to only include txouts paid to specified addresses.\n"
2247+
"Results are an array of Objects, each of which has:\n"
2248+
"{txid, vout, scriptPubKey, amount, confirmations}\n"
2249+
"\nArguments:\n"
2250+
"1. minconf (numeric, optional, default=1) The minimum confirmations to filter\n"
2251+
"2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter\n"
2252+
"3. \"addresses\" (string) A json array of bitcoin addresses to filter\n"
2253+
" [\n"
2254+
" \"address\" (string) bitcoin address\n"
2255+
" ,...\n"
2256+
" ]\n"
2257+
"\nResult\n"
2258+
"[ (array of json object)\n"
2259+
" {\n"
2260+
" \"txid\" : \"txid\", (string) the transaction id \n"
2261+
" \"vout\" : n, (numeric) the vout value\n"
2262+
" \"address\" : \"address\", (string) the bitcoin address\n"
2263+
" \"account\" : \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account\n"
2264+
" \"scriptPubKey\" : \"key\", (string) the script key\n"
2265+
" \"amount\" : x.xxx, (numeric) the transaction amount in btc\n"
2266+
" \"confirmations\" : n (numeric) The number of confirmations\n"
2267+
" }\n"
2268+
" ,...\n"
2269+
"]\n"
2270+
2271+
"\nExamples\n"
2272+
+ HelpExampleCli("listunspent", "")
2273+
+ HelpExampleCli("listunspent", "6 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
2274+
+ HelpExampleRpc("listunspent", "6, 9999999 \"[\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\",\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\"]\"")
2275+
);
2276+
22772277
RPCTypeCheck(params, boost::assign::list_of(int_type)(int_type)(array_type));
2278-
2278+
22792279
int nMinDepth = 1;
22802280
if (params.size() > 0)
2281-
nMinDepth = params[0].get_int();
2282-
2281+
nMinDepth = params[0].get_int();
2282+
22832283
int nMaxDepth = 9999999;
22842284
if (params.size() > 1)
2285-
nMaxDepth = params[1].get_int();
2286-
2285+
nMaxDepth = params[1].get_int();
2286+
22872287
set<CBitcoinAddress> setAddress;
22882288
if (params.size() > 2) {
22892289
Array inputs = params[2].get_array();
22902290
BOOST_FOREACH(Value& input, inputs) {
22912291
CBitcoinAddress address(input.get_str());
22922292
if (!address.IsValid())
2293-
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Bitcoin address: ")+input.get_str());
2293+
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid Bitcoin address: ")+input.get_str());
22942294
if (setAddress.count(address))
2295-
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+input.get_str());
2296-
setAddress.insert(address);
2295+
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+input.get_str());
2296+
setAddress.insert(address);
22972297
}
22982298
}
2299-
2299+
23002300
Array results;
23012301
vector<COutput> vecOutputs;
23022302
assert(pwalletMain != NULL);
23032303
LOCK2(cs_main, pwalletMain->cs_wallet);
23042304
pwalletMain->AvailableCoins(vecOutputs, false);
23052305
BOOST_FOREACH(const COutput& out, vecOutputs) {
23062306
if (out.nDepth < nMinDepth || out.nDepth > nMaxDepth)
2307-
continue;
2308-
2307+
continue;
2308+
23092309
if (setAddress.size()) {
23102310
CTxDestination address;
23112311
if (!ExtractDestination(out.tx->vout[out.i].scriptPubKey, address))
2312-
continue;
2313-
2312+
continue;
2313+
23142314
if (!setAddress.count(address))
2315-
continue;
2315+
continue;
23162316
}
2317-
2317+
23182318
CAmount nValue = out.tx->vout[out.i].nValue;
23192319
const CScript& pk = out.tx->vout[out.i].scriptPubKey;
23202320
Object entry;
@@ -2324,7 +2324,7 @@ Value listunspent(const Array& params, bool fHelp)
23242324
if (ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) {
23252325
entry.push_back(Pair("address", CBitcoinAddress(address).ToString()));
23262326
if (pwalletMain->mapAddressBook.count(address))
2327-
entry.push_back(Pair("account", pwalletMain->mapAddressBook[address].name));
2327+
entry.push_back(Pair("account", pwalletMain->mapAddressBook[address].name));
23282328
}
23292329
entry.push_back(Pair("scriptPubKey", HexStr(pk.begin(), pk.end())));
23302330
if (pk.IsPayToScriptHash()) {
@@ -2333,14 +2333,14 @@ Value listunspent(const Array& params, bool fHelp)
23332333
const CScriptID& hash = boost::get<const CScriptID&>(address);
23342334
CScript redeemScript;
23352335
if (pwalletMain->GetCScript(hash, redeemScript))
2336-
entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end())));
2336+
entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end())));
23372337
}
23382338
}
23392339
entry.push_back(Pair("amount",ValueFromAmount(nValue)));
23402340
entry.push_back(Pair("confirmations",out.nDepth));
23412341
entry.push_back(Pair("spendable", out.fSpendable));
23422342
results.push_back(entry);
23432343
}
2344-
2344+
23452345
return results;
23462346
}

0 commit comments

Comments
 (0)