mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-17 12:21:17 +02:00
refactor: Make ListSelected return vector
This commit is contained in:
parent
94776621ba
commit
daba95700b
@ -412,8 +412,7 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
|
|||||||
unsigned int nQuantity = 0;
|
unsigned int nQuantity = 0;
|
||||||
bool fWitness = false;
|
bool fWitness = false;
|
||||||
|
|
||||||
std::vector<COutPoint> vCoinControl;
|
auto vCoinControl{m_coin_control.ListSelected()};
|
||||||
m_coin_control.ListSelected(vCoinControl);
|
|
||||||
|
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
for (const auto& out : model->wallet().getCoins(vCoinControl)) {
|
for (const auto& out : model->wallet().getCoins(vCoinControl)) {
|
||||||
|
@ -58,9 +58,9 @@ void CCoinControl::UnSelectAll()
|
|||||||
m_selected_inputs.clear();
|
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)
|
void CCoinControl::SetInputWeight(const COutPoint& outpoint, int64_t weight)
|
||||||
|
@ -100,7 +100,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* List the selected inputs.
|
* List the selected inputs.
|
||||||
*/
|
*/
|
||||||
void ListSelected(std::vector<COutPoint>& vOutpoints) const;
|
std::vector<COutPoint> ListSelected() const;
|
||||||
/**
|
/**
|
||||||
* Set an input's weight.
|
* 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)
|
const CoinSelectionParams& coin_selection_params) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
|
||||||
{
|
{
|
||||||
PreSelectedInputs result;
|
PreSelectedInputs result;
|
||||||
std::vector<COutPoint> vPresetInputs;
|
|
||||||
coin_control.ListSelected(vPresetInputs);
|
|
||||||
const bool can_grind_r = wallet.CanGrindR();
|
const bool can_grind_r = wallet.CanGrindR();
|
||||||
for (const COutPoint& outpoint : vPresetInputs) {
|
for (const COutPoint& outpoint : coin_control.ListSelected()) {
|
||||||
int input_bytes = -1;
|
int input_bytes = -1;
|
||||||
CTxOut txout;
|
CTxOut txout;
|
||||||
if (auto ptr_wtx = wallet.GetWalletTx(outpoint.hash)) {
|
if (auto ptr_wtx = wallet.GetWalletTx(outpoint.hash)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user