aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/coinselection.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2022-01-17 17:21:36 -0500
committerAndrew Chow <achow101-github@achow101.com>2022-03-23 15:01:39 -0400
commitf6c39c6adb6cbf9c87f04d3d667701905ef5c0a0 (patch)
tree2e11b99d6643591c0e43c9fb2b191032e3674bbd /src/wallet/coinselection.h
parent70f31f1a81710aa59e95770de9a84bf58cbce1e8 (diff)
downloadbitcoin-f6c39c6adb6cbf9c87f04d3d667701905ef5c0a0.tar.xz
coinselection: Remove CInputCoin
It is no longer needed as everything it was doing is now done by COutput
Diffstat (limited to 'src/wallet/coinselection.h')
-rw-r--r--src/wallet/coinselection.h58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/wallet/coinselection.h b/src/wallet/coinselection.h
index 4d39be364c..ff85dd5fe2 100644
--- a/src/wallet/coinselection.h
+++ b/src/wallet/coinselection.h
@@ -19,59 +19,6 @@ 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 CInputCoin {
-public:
- CInputCoin(const CTransactionRef& tx, unsigned int i)
- {
- if (!tx)
- throw std::invalid_argument("tx should not be null");
- if (i >= tx->vout.size())
- throw std::out_of_range("The output index is out of range");
-
- outpoint = COutPoint(tx->GetHash(), i);
- txout = tx->vout[i];
- effective_value = txout.nValue;
- }
-
- CInputCoin(const CTransactionRef& tx, unsigned int i, int input_bytes) : CInputCoin(tx, i)
- {
- m_input_bytes = input_bytes;
- }
-
- CInputCoin(const COutPoint& outpoint_in, const CTxOut& txout_in)
- {
- outpoint = outpoint_in;
- txout = txout_in;
- effective_value = txout.nValue;
- }
-
- CInputCoin(const COutPoint& outpoint_in, const CTxOut& txout_in, int input_bytes) : CInputCoin(outpoint_in, txout_in)
- {
- m_input_bytes = input_bytes;
- }
-
- COutPoint outpoint;
- CTxOut txout;
- CAmount effective_value;
- CAmount m_fee{0};
- CAmount m_long_term_fee{0};
-
- /** Pre-computed estimated size of this output as a fully-signed input in a transaction. Can be -1 if it could not be calculated */
- int m_input_bytes{-1};
-
- bool operator<(const CInputCoin& rhs) const {
- return outpoint < rhs.outpoint;
- }
-
- bool operator!=(const CInputCoin& rhs) const {
- return outpoint != rhs.outpoint;
- }
-
- bool operator==(const CInputCoin& rhs) const {
- return outpoint == rhs.outpoint;
- }
-};
-
class COutput
{
public:
@@ -134,11 +81,6 @@ public:
std::string ToString() const;
- inline CInputCoin GetInputCoin() const
- {
- return CInputCoin(outpoint, txout, input_bytes);
- }
-
bool operator<(const COutput& rhs) const {
return outpoint < rhs.outpoint;
}