24
24
25
25
26
26
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)
28
28
{
29
+ std::vector<CRecipient> recipients;
29
30
std::set<CTxDestination> destinations;
30
31
int i = 0 ;
31
32
for (const std::string& address: address_amounts.getKeys ()) {
@@ -52,6 +53,7 @@ static void ParseRecipients(const UniValue& address_amounts, const UniValue& sub
52
53
CRecipient recipient = {dest, amount, subtract_fee};
53
54
recipients.push_back (recipient);
54
55
}
56
+ return recipients;
55
57
}
56
58
57
59
static void InterpretFeeEstimationInstructions (const UniValue& conf_target, const UniValue& estimate_mode, const UniValue& fee_rate, UniValue& options)
@@ -301,8 +303,7 @@ RPCHelpMan sendtoaddress()
301
303
subtractFeeFromAmount.push_back (address);
302
304
}
303
305
304
- std::vector<CRecipient> recipients;
305
- ParseRecipients (address_amounts, subtractFeeFromAmount, recipients);
306
+ std::vector<CRecipient> recipients = CreateRecipients (address_amounts, subtractFeeFromAmount);
306
307
const bool verbose{request.params [10 ].isNull () ? false : request.params [10 ].get_bool ()};
307
308
308
309
return SendMoney (*pwallet, coin_control, recipients, mapValue, verbose);
@@ -397,8 +398,7 @@ RPCHelpMan sendmany()
397
398
398
399
SetFeeEstimateMode (*pwallet, coin_control, /* conf_target=*/ request.params [6 ], /* estimate_mode=*/ request.params [7 ], /* fee_rate=*/ request.params [8 ], /* override_min_fee=*/ false );
399
400
400
- std::vector<CRecipient> recipients;
401
- ParseRecipients (sendTo, subtractFeeFromAmount, recipients);
401
+ std::vector<CRecipient> recipients = CreateRecipients (sendTo, subtractFeeFromAmount);
402
402
const bool verbose{request.params [9 ].isNull () ? false : request.params [9 ].get_bool ()};
403
403
404
404
return SendMoney (*pwallet, coin_control, recipients, std::move (mapValue), verbose);
0 commit comments