From becc45b589d07c4523276e4ba2dad8852d0d2632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A8le=20Oul=C3=A8s?= Date: Tue, 13 Sep 2022 18:59:54 +0200 Subject: [PATCH 1/4] scripted-diff: Rename setSelected->m_selected_inputs -BEGIN VERIFY SCRIPT- sed -i 's/setSelected/m_selected_inputs/g' src/wallet/coincontrol.h src/wallet/coincontrol.cpp -END VERIFY SCRIPT- --- src/wallet/coincontrol.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/wallet/coincontrol.h b/src/wallet/coincontrol.h index cb6f0a1635..86069d005e 100644 --- a/src/wallet/coincontrol.h +++ b/src/wallet/coincontrol.h @@ -65,12 +65,12 @@ public: bool HasSelected() const { - return (setSelected.size() > 0); + return (m_selected_inputs.size() > 0); } bool IsSelected(const COutPoint& output) const { - return (setSelected.count(output) > 0); + return (m_selected_inputs.count(output) > 0); } bool IsExternalSelected(const COutPoint& output) const @@ -90,28 +90,28 @@ public: void Select(const COutPoint& output) { - setSelected.insert(output); + m_selected_inputs.insert(output); } void SelectExternal(const COutPoint& outpoint, const CTxOut& txout) { - setSelected.insert(outpoint); + m_selected_inputs.insert(outpoint); m_external_txouts.emplace(outpoint, txout); } void UnSelect(const COutPoint& output) { - setSelected.erase(output); + m_selected_inputs.erase(output); } void UnSelectAll() { - setSelected.clear(); + m_selected_inputs.clear(); } void ListSelected(std::vector& vOutpoints) const { - vOutpoints.assign(setSelected.begin(), setSelected.end()); + vOutpoints.assign(m_selected_inputs.begin(), m_selected_inputs.end()); } void SetInputWeight(const COutPoint& outpoint, int64_t weight) @@ -132,7 +132,7 @@ public: } private: - std::set setSelected; + std::set m_selected_inputs; std::map m_external_txouts; //! Map of COutPoints to the maximum weight for that input std::map m_input_weights; From 1db23da6e163e793458ec702a9601d2837aea9cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A8le=20Oul=C3=A8s?= Date: Mon, 12 Sep 2022 12:03:07 +0200 Subject: [PATCH 2/4] wallet: Use std::optional for GetExternalOutput and fixups --- src/wallet/coincontrol.h | 16 ++++++++-------- src/wallet/spend.cpp | 17 ++++++++--------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/wallet/coincontrol.h b/src/wallet/coincontrol.h index 86069d005e..04f524028f 100644 --- a/src/wallet/coincontrol.h +++ b/src/wallet/coincontrol.h @@ -13,9 +13,9 @@ #include