Skip to content

Commit 14fbb57

Browse files
committed
coinselection: Add effective value and fees to COutput
1 parent f082123 commit 14fbb57

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/wallet/coinselection.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ class COutput
110110
/** Whether the transaction containing this output is sent from the owning wallet */
111111
bool from_me;
112112

113+
/** The output's value minus fees required to spend it. Initialized as the output's absolute value. */
114+
CAmount effective_value;
115+
116+
/** The fee required to spend this output at the transaction's target feerate. */
117+
CAmount fee{0};
118+
119+
/** The fee required to spend this output at the consolidation feerate. */
120+
CAmount long_term_fee{0};
121+
113122
COutput(const COutPoint& outpoint, const CTxOut& txout, int depth, int input_bytes, bool spendable, bool solvable, bool safe, int64_t time, bool from_me)
114123
: outpoint(outpoint),
115124
txout(txout),
@@ -119,7 +128,8 @@ class COutput
119128
solvable(solvable),
120129
safe(safe),
121130
time(time),
122-
from_me(from_me)
131+
from_me(from_me),
132+
effective_value(txout.nValue)
123133
{}
124134

125135
std::string ToString() const;

0 commit comments

Comments
 (0)