mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
refactor: Make ListSelected return vector
This commit is contained in:
parent
94776621ba
commit
daba95700b
4 changed files with 5 additions and 8 deletions
|
@ -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)) {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue