From fa61cdf464381dddd9da076b1a1cab95ff5b3baf Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 25 Mar 2022 09:58:31 +0100 Subject: [PATCH 1/2] wallet: Fix coinselection include coinselection.h is not used by wallet.h but by qt/coincontroldialog.cpp --- src/qt/coincontroldialog.cpp | 3 ++- src/wallet/wallet.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index d7a2aaaf19a..4ece886488b 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -16,10 +16,11 @@ #include #include -#include #include #include #include +#include +#include #include #include diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index e2c5c69c91e..a1129290740 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -112,7 +111,6 @@ constexpr CAmount HIGH_MAX_TX_FEE{100 * HIGH_TX_FEE_PER_KB}; static constexpr size_t DUMMY_NESTED_P2WPKH_INPUT_SIZE = 91; class CCoinControl; -class COutput; class CWalletTx; class ReserveDestination; From fab287cedde85b21622d767d3ece65291e18b0bf Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 25 Mar 2022 10:08:59 +0100 Subject: [PATCH 2/2] Clarify that COutput is a struct, not a class Also, use {}-initialization --- src/wallet/coinselection.h | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/wallet/coinselection.h b/src/wallet/coinselection.h index 504d57aa785..da77b216268 100644 --- a/src/wallet/coinselection.h +++ b/src/wallet/coinselection.h @@ -19,9 +19,7 @@ static constexpr CAmount MIN_CHANGE{COIN / 100}; static const CAmount MIN_FINAL_CHANGE = MIN_CHANGE/2; /** A UTXO under consideration for use in funding a new transaction. */ -class COutput -{ -public: +struct COutput { /** The outpoint identifying this UTXO */ COutPoint outpoint; @@ -67,21 +65,22 @@ public: CAmount long_term_fee{0}; COutput(const COutPoint& outpoint, const CTxOut& txout, int depth, int input_bytes, bool spendable, bool solvable, bool safe, int64_t time, bool from_me) - : outpoint(outpoint), - txout(txout), - depth(depth), - input_bytes(input_bytes), - spendable(spendable), - solvable(solvable), - safe(safe), - time(time), - from_me(from_me), - effective_value(txout.nValue) + : outpoint{outpoint}, + txout{txout}, + depth{depth}, + input_bytes{input_bytes}, + spendable{spendable}, + solvable{solvable}, + safe{safe}, + time{time}, + from_me{from_me}, + effective_value{txout.nValue} {} std::string ToString() const; - bool operator<(const COutput& rhs) const { + bool operator<(const COutput& rhs) const + { return outpoint < rhs.outpoint; } };