aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpc
diff options
context:
space:
mode:
authorjosibake <josibake@protonmail.com>2023-12-22 13:58:56 +0100
committerjosibake <josibake@protonmail.com>2024-01-19 15:04:56 +0100
commit47353a608dc6e20e5fd2ca53850d6f9aa3240d4a (patch)
treef2a7f83a649837202d64b75961c0a635b4602b11 /src/wallet/rpc
parentf7384b921c3460c7a3cc7827a68b2c613bd98f8e (diff)
downloadbitcoin-47353a608dc6e20e5fd2ca53850d6f9aa3240d4a.tar.xz
refactor: remove out param from `ParseRecipients`
Have `ParseRecipients` return a vector of `CRecipients` and rename to `CreateRecipients`.
Diffstat (limited to 'src/wallet/rpc')
-rw-r--r--src/wallet/rpc/spend.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp
index 5a13b5ac8e..eb3e607320 100644
--- a/src/wallet/rpc/spend.cpp
+++ b/src/wallet/rpc/spend.cpp
@@ -24,8 +24,9 @@
namespace wallet {
-static void ParseRecipients(const UniValue& address_amounts, const UniValue& subtract_fee_outputs, std::vector<CRecipient>& recipients)
+std::vector<CRecipient> CreateRecipients(const UniValue& address_amounts, const UniValue& subtract_fee_outputs)
{
+ std::vector<CRecipient> recipients;
std::set<CTxDestination> destinations;
int i = 0;
for (const std::string& address: address_amounts.getKeys()) {
@@ -52,6 +53,7 @@ static void ParseRecipients(const UniValue& address_amounts, const UniValue& sub
CRecipient recipient = {dest, amount, subtract_fee};
recipients.push_back(recipient);
}
+ return recipients;
}
static void InterpretFeeEstimationInstructions(const UniValue& conf_target, const UniValue& estimate_mode, const UniValue& fee_rate, UniValue& options)
@@ -301,8 +303,7 @@ RPCHelpMan sendtoaddress()
subtractFeeFromAmount.push_back(address);
}
- std::vector<CRecipient> recipients;
- ParseRecipients(address_amounts, subtractFeeFromAmount, recipients);
+ std::vector<CRecipient> recipients = CreateRecipients(address_amounts, subtractFeeFromAmount);
const bool verbose{request.params[10].isNull() ? false : request.params[10].get_bool()};
return SendMoney(*pwallet, coin_control, recipients, mapValue, verbose);
@@ -397,8 +398,7 @@ RPCHelpMan sendmany()
SetFeeEstimateMode(*pwallet, coin_control, /*conf_target=*/request.params[6], /*estimate_mode=*/request.params[7], /*fee_rate=*/request.params[8], /*override_min_fee=*/false);
- std::vector<CRecipient> recipients;
- ParseRecipients(sendTo, subtractFeeFromAmount, recipients);
+ std::vector<CRecipient> recipients = CreateRecipients(sendTo, subtractFeeFromAmount);
const bool verbose{request.params[9].isNull() ? false : request.params[9].get_bool()};
return SendMoney(*pwallet, coin_control, recipients, std::move(mapValue), verbose);