Skip to content

Commit fab287c

Browse files
author
MarcoFalke
committed
Clarify that COutput is a struct, not a class
Also, use {}-initialization
1 parent fa61cdf commit fab287c

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

src/wallet/coinselection.h

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ static constexpr CAmount MIN_CHANGE{COIN / 100};
1919
static const CAmount MIN_FINAL_CHANGE = MIN_CHANGE/2;
2020

2121
/** A UTXO under consideration for use in funding a new transaction. */
22-
class COutput
23-
{
24-
public:
22+
struct COutput {
2523
/** The outpoint identifying this UTXO */
2624
COutPoint outpoint;
2725

@@ -67,21 +65,22 @@ class COutput
6765
CAmount long_term_fee{0};
6866

6967
COutput(const COutPoint& outpoint, const CTxOut& txout, int depth, int input_bytes, bool spendable, bool solvable, bool safe, int64_t time, bool from_me)
70-
: outpoint(outpoint),
71-
txout(txout),
72-
depth(depth),
73-
input_bytes(input_bytes),
74-
spendable(spendable),
75-
solvable(solvable),
76-
safe(safe),
77-
time(time),
78-
from_me(from_me),
79-
effective_value(txout.nValue)
68+
: outpoint{outpoint},
69+
txout{txout},
70+
depth{depth},
71+
input_bytes{input_bytes},
72+
spendable{spendable},
73+
solvable{solvable},
74+
safe{safe},
75+
time{time},
76+
from_me{from_me},
77+
effective_value{txout.nValue}
8078
{}
8179

8280
std::string ToString() const;
8381

84-
bool operator<(const COutput& rhs) const {
82+
bool operator<(const COutput& rhs) const
83+
{
8584
return outpoint < rhs.outpoint;
8685
}
8786
};

0 commit comments

Comments
 (0)