Skip to content

Commit 6b1f937

Browse files
committed
Merge bitcoin/bitcoin#24666: refactor: Fix coinselection.h include, Make COutput a struct
fab287c Clarify that COutput is a struct, not a class (MarcoFalke) fa61cdf wallet: Fix coinselection include (MarcoFalke) Pull request description: * Fix include (see commit message) * `{}`-init, see bitcoin/bitcoin#24091 (comment) * `struct`, see bitcoin/bitcoin#24091 (comment) ACKs for top commit: theStack: Code-review ACK fab287c Tree-SHA512: dd2cfb9c06a92295dbd8fbb6d56afcf00ebda2a0440e301d392cd183d1b9cd87626311d539e302a9e6c6521d69d6183c74a51934e3fc16e64a5dcaba60c7e3ce
2 parents f10b24a + fab287c commit 6b1f937

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

src/qt/coincontroldialog.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
#include <qt/platformstyle.h>
1717
#include <qt/walletmodel.h>
1818

19-
#include <wallet/coincontrol.h>
2019
#include <interfaces/node.h>
2120
#include <key_io.h>
2221
#include <policy/policy.h>
22+
#include <wallet/coincontrol.h>
23+
#include <wallet/coinselection.h>
2324
#include <wallet/wallet.h>
2425

2526
#include <QApplication>

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
};

src/wallet/wallet.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <util/system.h>
2121
#include <util/ui_change_type.h>
2222
#include <validationinterface.h>
23-
#include <wallet/coinselection.h>
2423
#include <wallet/crypter.h>
2524
#include <wallet/scriptpubkeyman.h>
2625
#include <wallet/transaction.h>
@@ -112,7 +111,6 @@ constexpr CAmount HIGH_MAX_TX_FEE{100 * HIGH_TX_FEE_PER_KB};
112111
static constexpr size_t DUMMY_NESTED_P2WPKH_INPUT_SIZE = 91;
113112

114113
class CCoinControl;
115-
class COutput;
116114
class CWalletTx;
117115
class ReserveDestination;
118116

0 commit comments

Comments
 (0)