mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-12 10:30:08 +01:00
scripted-diff: wallet: rename AvailableCoinsParams members to snake_case
-BEGIN VERIFY SCRIPT- sed -i 's/nMinimumAmount/min_amount/g' $(git grep -l nMinimumAmount) sed -i 's/nMaximumAmount/max_amount/g' $(git grep -l nMaximumAmount) sed -i 's/nMinimumSumAmount/min_sum_amount/g' $(git grep -l nMinimumSumAmount) sed -i 's/nMaximumCount/max_count/g' $(git grep -l nMaximumCount) -END VERIFY SCRIPT-
This commit is contained in:
parent
61c2265629
commit
fa84df1f03
5 changed files with 15 additions and 15 deletions
|
@ -112,7 +112,7 @@ static void WalletCreateTx(benchmark::Bench& bench, const OutputType output_type
|
||||||
if (preset_inputs) {
|
if (preset_inputs) {
|
||||||
// Select inputs, each has 49 BTC
|
// Select inputs, each has 49 BTC
|
||||||
wallet::CoinFilterParams filter_coins;
|
wallet::CoinFilterParams filter_coins;
|
||||||
filter_coins.nMaximumCount = preset_inputs->num_of_internal_inputs;
|
filter_coins.max_count = preset_inputs->num_of_internal_inputs;
|
||||||
const auto& res = WITH_LOCK(wallet.cs_wallet,
|
const auto& res = WITH_LOCK(wallet.cs_wallet,
|
||||||
return wallet::AvailableCoins(wallet, /*coinControl=*/nullptr, /*feerate=*/std::nullopt, filter_coins));
|
return wallet::AvailableCoins(wallet, /*coinControl=*/nullptr, /*feerate=*/std::nullopt, filter_coins));
|
||||||
for (int i=0; i < preset_inputs->num_of_internal_inputs; i++) {
|
for (int i=0; i < preset_inputs->num_of_internal_inputs; i++) {
|
||||||
|
|
|
@ -592,7 +592,7 @@ RPCHelpMan listunspent()
|
||||||
}
|
}
|
||||||
|
|
||||||
CoinFilterParams filter_coins;
|
CoinFilterParams filter_coins;
|
||||||
filter_coins.nMinimumAmount = 0;
|
filter_coins.min_amount = 0;
|
||||||
|
|
||||||
if (!request.params[4].isNull()) {
|
if (!request.params[4].isNull()) {
|
||||||
const UniValue& options = request.params[4].get_obj();
|
const UniValue& options = request.params[4].get_obj();
|
||||||
|
@ -608,16 +608,16 @@ RPCHelpMan listunspent()
|
||||||
true, true);
|
true, true);
|
||||||
|
|
||||||
if (options.exists("minimumAmount"))
|
if (options.exists("minimumAmount"))
|
||||||
filter_coins.nMinimumAmount = AmountFromValue(options["minimumAmount"]);
|
filter_coins.min_amount = AmountFromValue(options["minimumAmount"]);
|
||||||
|
|
||||||
if (options.exists("maximumAmount"))
|
if (options.exists("maximumAmount"))
|
||||||
filter_coins.nMaximumAmount = AmountFromValue(options["maximumAmount"]);
|
filter_coins.max_amount = AmountFromValue(options["maximumAmount"]);
|
||||||
|
|
||||||
if (options.exists("minimumSumAmount"))
|
if (options.exists("minimumSumAmount"))
|
||||||
filter_coins.nMinimumSumAmount = AmountFromValue(options["minimumSumAmount"]);
|
filter_coins.min_sum_amount = AmountFromValue(options["minimumSumAmount"]);
|
||||||
|
|
||||||
if (options.exists("maximumCount"))
|
if (options.exists("maximumCount"))
|
||||||
filter_coins.nMaximumCount = options["maximumCount"].getInt<int64_t>();
|
filter_coins.max_count = options["maximumCount"].getInt<int64_t>();
|
||||||
|
|
||||||
if (options.exists("include_immature_coinbase")) {
|
if (options.exists("include_immature_coinbase")) {
|
||||||
filter_coins.include_immature_coinbase = options["include_immature_coinbase"].get_bool();
|
filter_coins.include_immature_coinbase = options["include_immature_coinbase"].get_bool();
|
||||||
|
|
|
@ -1386,7 +1386,7 @@ RPCHelpMan sendall()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CoinFilterParams coins_params;
|
CoinFilterParams coins_params;
|
||||||
coins_params.nMinimumAmount = 0;
|
coins_params.min_amount = 0;
|
||||||
for (const COutput& output : AvailableCoins(*pwallet, &coin_control, fee_rate, coins_params).All()) {
|
for (const COutput& output : AvailableCoins(*pwallet, &coin_control, fee_rate, coins_params).All()) {
|
||||||
CHECK_NONFATAL(output.input_bytes > 0);
|
CHECK_NONFATAL(output.input_bytes > 0);
|
||||||
if (send_max && fee_rate.GetFee(output.input_bytes) > output.txout.nValue) {
|
if (send_max && fee_rate.GetFee(output.input_bytes) > output.txout.nValue) {
|
||||||
|
|
|
@ -268,7 +268,7 @@ CoinsResult AvailableCoins(const CWallet& wallet,
|
||||||
const CTxOut& output = wtx.tx->vout[i];
|
const CTxOut& output = wtx.tx->vout[i];
|
||||||
const COutPoint outpoint(wtxid, i);
|
const COutPoint outpoint(wtxid, i);
|
||||||
|
|
||||||
if (output.nValue < params.nMinimumAmount || output.nValue > params.nMaximumAmount)
|
if (output.nValue < params.min_amount || output.nValue > params.max_amount)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Skip manually selected coins (the caller can fetch them directly)
|
// Skip manually selected coins (the caller can fetch them directly)
|
||||||
|
@ -324,14 +324,14 @@ CoinsResult AvailableCoins(const CWallet& wallet,
|
||||||
// Cache total amount as we go
|
// Cache total amount as we go
|
||||||
result.total_amount += output.nValue;
|
result.total_amount += output.nValue;
|
||||||
// Checks the sum amount of all UTXO's.
|
// Checks the sum amount of all UTXO's.
|
||||||
if (params.nMinimumSumAmount != MAX_MONEY) {
|
if (params.min_sum_amount != MAX_MONEY) {
|
||||||
if (result.total_amount >= params.nMinimumSumAmount) {
|
if (result.total_amount >= params.min_sum_amount) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks the maximum number of UTXO's.
|
// Checks the maximum number of UTXO's.
|
||||||
if (params.nMaximumCount > 0 && result.Size() >= params.nMaximumCount) {
|
if (params.max_count > 0 && result.Size() >= params.max_count) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,13 +57,13 @@ struct CoinsResult {
|
||||||
|
|
||||||
struct CoinFilterParams {
|
struct CoinFilterParams {
|
||||||
// Outputs below the minimum amount will not get selected
|
// Outputs below the minimum amount will not get selected
|
||||||
CAmount nMinimumAmount{1};
|
CAmount min_amount{1};
|
||||||
// Outputs above the maximum amount will not get selected
|
// Outputs above the maximum amount will not get selected
|
||||||
CAmount nMaximumAmount{MAX_MONEY};
|
CAmount max_amount{MAX_MONEY};
|
||||||
// Return outputs until the minimum sum amount is covered
|
// Return outputs until the minimum sum amount is covered
|
||||||
CAmount nMinimumSumAmount{MAX_MONEY};
|
CAmount min_sum_amount{MAX_MONEY};
|
||||||
// Maximum number of outputs that can be returned
|
// Maximum number of outputs that can be returned
|
||||||
uint64_t nMaximumCount{0};
|
uint64_t max_count{0};
|
||||||
// By default, return only spendable outputs
|
// By default, return only spendable outputs
|
||||||
bool only_spendable{true};
|
bool only_spendable{true};
|
||||||
// By default, do not include immature coinbase outputs
|
// By default, do not include immature coinbase outputs
|
||||||
|
|
Loading…
Add table
Reference in a new issue