refactor: Make ListSelected return vector

This commit is contained in:
Sebastian Falbesoner authored and Aurèle Oulès committed 2023-04-26 10:41:10 +02:00
1 parent 94776621ba
commit daba95700b
4 files changed
+5 -8

No files matched your search

+1 -2
View File
@@ -412,8 +412,7 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
unsigned int nQuantity = 0;
bool fWitness = false;
std::vector<COutPoint> vCoinControl;
m_coin_control.ListSelected(vCoinControl);
auto vCoinControl{m_coin_control.ListSelected()};
size_t i = 0;
for (const auto& out : model->wallet().getCoins(vCoinControl)) {
+2 -2
View File
@@ -58,9 +58,9 @@ void CCoinControl::UnSelectAll()
m_selected_inputs.clear();
}
void CCoinControl::ListSelected(std::vector<COutPoint>& vOutpoints) const
std::vector<COutPoint> CCoinControl::ListSelected() const
{
vOutpoints.assign(m_selected_inputs.begin(), m_selected_inputs.end());
return {m_selected_inputs.begin(), m_selected_inputs.end()};
}
void CCoinControl::SetInputWeight(const COutPoint& outpoint, int64_t weight)
+1 -1
View File
@@ -100,7 +100,7 @@ public:
/**
* List the selected inputs.
*/
void ListSelected(std::vector<COutPoint>& vOutpoints) const;
std::vector<COutPoint> ListSelected() const;
/**
* Set an input's weight.
*/
+1 -3
View File
@@ -159,10 +159,8 @@ util::Result<PreSelectedInputs> FetchSelectedInputs(const CWallet& wallet, const
const CoinSelectionParams& coin_selection_params) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
{
PreSelectedInputs result;
std::vector<COutPoint> vPresetInputs;
coin_control.ListSelected(vPresetInputs);
const bool can_grind_r = wallet.CanGrindR();
for (const COutPoint& outpoint : vPresetInputs) {
for (const COutPoint& outpoint : coin_control.ListSelected()) {
int input_bytes = -1;
CTxOut txout;
if (auto ptr_wtx = wallet.GetWalletTx(outpoint.hash)) {