aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2018-03-07 12:18:37 -0500
committerAndrew Chow <achow101-github@achow101.com>2018-03-13 12:39:26 -0400
commit4b2716da46e96c45206db869b83c28c5fc7889f4 (patch)
tree79b43ea07fa17c0a2a56a3fcea75cd93aae510ba /src/wallet/wallet.h
parent7d77eb1a5b980a7d56acbf0b3861434c5e195c54 (diff)
downloadbitcoin-4b2716da46e96c45206db869b83c28c5fc7889f4.tar.xz
Remove coinselection.h -> wallet.h circular dependency
Changes CInputCoin to coinselection and to use CTransactionRef in order to avoid a circular dependency. Also moves other coin selection specific variables out of wallet.h to coinselectoin.h
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r--src/wallet/wallet.h39
1 files changed, 1 insertions, 38 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 4f195b2bcd..8f518bae63 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -17,6 +17,7 @@
#include <script/sign.h>
#include <util.h>
#include <wallet/crypter.h>
+#include <wallet/coinselection.h>
#include <wallet/walletdb.h>
#include <wallet/rpcwallet.h>
@@ -53,10 +54,6 @@ static const CAmount DEFAULT_DISCARD_FEE = 10000;
static const CAmount DEFAULT_TRANSACTION_MINFEE = 1000;
//! minimum recommended increment for BIP 125 replacement txs
static const CAmount WALLET_INCREMENTAL_RELAY_FEE = 5000;
-//! target minimum change amount
-static const CAmount MIN_CHANGE = CENT;
-//! final minimum change amount after paying for fees
-static const CAmount MIN_FINAL_CHANGE = MIN_CHANGE/2;
//! Default for -spendzeroconfchange
static const bool DEFAULT_SPEND_ZEROCONF_CHANGE = true;
//! Default for -walletrejectlongchains
@@ -497,40 +494,6 @@ public:
std::set<uint256> GetConflicts() const;
};
-
-class CInputCoin {
-public:
- CInputCoin(const CWalletTx* walletTx, unsigned int i)
- {
- if (!walletTx)
- throw std::invalid_argument("walletTx should not be null");
- if (i >= walletTx->tx->vout.size())
- throw std::out_of_range("The output index is out of range");
-
- outpoint = COutPoint(walletTx->GetHash(), i);
- txout = walletTx->tx->vout[i];
- effective_value = txout.nValue;
- }
-
- COutPoint outpoint;
- CTxOut txout;
- CAmount effective_value;
- CAmount fee = 0;
- CAmount long_term_fee = 0;
-
- 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: