diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2022-04-22 17:31:28 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2022-06-08 10:25:16 -0300 |
commit | 4ce235ef8f9a9dddc52d7ab60c8f71bda1d38873 (patch) | |
tree | 256749d54ebf6fae7ee0ae533bf5ad4de0be45ab /src/wallet/rpc/spend.cpp | |
parent | fbb90c44ac8a4121ce6ba7fcbf864084f35734ba (diff) |
wallet: return 'CoinsResult' struct in `AvailableCoins`
Instead of accepting a `vCoins` reference that is cleared at the beginning of the method.
Note:
This new struct, down the commits line, will contain other `AvailableCoins` useful results.
Diffstat (limited to 'src/wallet/rpc/spend.cpp')
-rw-r--r-- | src/wallet/rpc/spend.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp index d1a0ba50f6..98e180e4a1 100644 --- a/src/wallet/rpc/spend.cpp +++ b/src/wallet/rpc/spend.cpp @@ -1380,7 +1380,6 @@ RPCHelpMan sendall() CMutableTransaction rawTx{ConstructTransaction(options["inputs"], recipient_key_value_pairs, options["locktime"], rbf)}; LOCK(pwallet->cs_wallet); - std::vector<COutput> all_the_utxos; CAmount total_input_value(0); bool send_max{options.exists("send_max") ? options["send_max"].get_bool() : false}; @@ -1398,8 +1397,7 @@ RPCHelpMan sendall() total_input_value += tx->tx->vout[input.prevout.n].nValue; } } else { - AvailableCoins(*pwallet, all_the_utxos, &coin_control, fee_rate, /*nMinimumAmount=*/0); - for (const COutput& output : all_the_utxos) { + for (const COutput& output : AvailableCoins(*pwallet, &coin_control, fee_rate, /*nMinimumAmount=*/0).coins) { CHECK_NONFATAL(output.input_bytes > 0); if (send_max && fee_rate.GetFee(output.input_bytes) > output.txout.nValue) { continue; |