Skip to content

Commit 47353a6

Browse files
committed
refactor: remove out param from ParseRecipients
Have `ParseRecipients` return a vector of `CRecipients` and rename to `CreateRecipients`.
1 parent f7384b9 commit 47353a6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/wallet/rpc/spend.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424

2525

2626
namespace wallet {
27-
static void ParseRecipients(const UniValue& address_amounts, const UniValue& subtract_fee_outputs, std::vector<CRecipient>& recipients)
27+
std::vector<CRecipient> CreateRecipients(const UniValue& address_amounts, const UniValue& subtract_fee_outputs)
2828
{
29+
std::vector<CRecipient> recipients;
2930
std::set<CTxDestination> destinations;
3031
int i = 0;
3132
for (const std::string& address: address_amounts.getKeys()) {
@@ -52,6 +53,7 @@ static void ParseRecipients(const UniValue& address_amounts, const UniValue& sub
5253
CRecipient recipient = {dest, amount, subtract_fee};
5354
recipients.push_back(recipient);
5455
}
56+
return recipients;
5557
}
5658

5759
static void InterpretFeeEstimationInstructions(const UniValue& conf_target, const UniValue& estimate_mode, const UniValue& fee_rate, UniValue& options)
@@ -301,8 +303,7 @@ RPCHelpMan sendtoaddress()
301303
subtractFeeFromAmount.push_back(address);
302304
}
303305

304-
std::vector<CRecipient> recipients;
305-
ParseRecipients(address_amounts, subtractFeeFromAmount, recipients);
306+
std::vector<CRecipient> recipients = CreateRecipients(address_amounts, subtractFeeFromAmount);
306307
const bool verbose{request.params[10].isNull() ? false : request.params[10].get_bool()};
307308

308309
return SendMoney(*pwallet, coin_control, recipients, mapValue, verbose);
@@ -397,8 +398,7 @@ RPCHelpMan sendmany()
397398

398399
SetFeeEstimateMode(*pwallet, coin_control, /*conf_target=*/request.params[6], /*estimate_mode=*/request.params[7], /*fee_rate=*/request.params[8], /*override_min_fee=*/false);
399400

400-
std::vector<CRecipient> recipients;
401-
ParseRecipients(sendTo, subtractFeeFromAmount, recipients);
401+
std::vector<CRecipient> recipients = CreateRecipients(sendTo, subtractFeeFromAmount);
402402
const bool verbose{request.params[9].isNull() ? false : request.params[9].get_bool()};
403403

404404
return SendMoney(*pwallet, coin_control, recipients, std::move(mapValue), verbose);

0 commit comments

Comments
 (0)