|
17 | 17 | #include <script/sign.h> |
18 | 18 | #include <util.h> |
19 | 19 | #include <wallet/crypter.h> |
| 20 | +#include <wallet/coinselection.h> |
20 | 21 | #include <wallet/walletdb.h> |
21 | 22 | #include <wallet/rpcwallet.h> |
22 | 23 |
|
@@ -53,10 +54,6 @@ static const CAmount DEFAULT_DISCARD_FEE = 10000; |
53 | 54 | static const CAmount DEFAULT_TRANSACTION_MINFEE = 1000; |
54 | 55 | //! minimum recommended increment for BIP 125 replacement txs |
55 | 56 | static const CAmount WALLET_INCREMENTAL_RELAY_FEE = 5000; |
56 | | -//! target minimum change amount |
57 | | -static const CAmount MIN_CHANGE = CENT; |
58 | | -//! final minimum change amount after paying for fees |
59 | | -static const CAmount MIN_FINAL_CHANGE = MIN_CHANGE/2; |
60 | 57 | //! Default for -spendzeroconfchange |
61 | 58 | static const bool DEFAULT_SPEND_ZEROCONF_CHANGE = true; |
62 | 59 | //! Default for -walletrejectlongchains |
@@ -497,40 +494,6 @@ class CWalletTx : public CMerkleTx |
497 | 494 | std::set<uint256> GetConflicts() const; |
498 | 495 | }; |
499 | 496 |
|
500 | | - |
501 | | -class CInputCoin { |
502 | | -public: |
503 | | - CInputCoin(const CWalletTx* walletTx, unsigned int i) |
504 | | - { |
505 | | - if (!walletTx) |
506 | | - throw std::invalid_argument("walletTx should not be null"); |
507 | | - if (i >= walletTx->tx->vout.size()) |
508 | | - throw std::out_of_range("The output index is out of range"); |
509 | | - |
510 | | - outpoint = COutPoint(walletTx->GetHash(), i); |
511 | | - txout = walletTx->tx->vout[i]; |
512 | | - effective_value = txout.nValue; |
513 | | - } |
514 | | - |
515 | | - COutPoint outpoint; |
516 | | - CTxOut txout; |
517 | | - CAmount effective_value; |
518 | | - CAmount fee = 0; |
519 | | - CAmount long_term_fee = 0; |
520 | | - |
521 | | - bool operator<(const CInputCoin& rhs) const { |
522 | | - return outpoint < rhs.outpoint; |
523 | | - } |
524 | | - |
525 | | - bool operator!=(const CInputCoin& rhs) const { |
526 | | - return outpoint != rhs.outpoint; |
527 | | - } |
528 | | - |
529 | | - bool operator==(const CInputCoin& rhs) const { |
530 | | - return outpoint == rhs.outpoint; |
531 | | - } |
532 | | -}; |
533 | | - |
534 | 497 | class COutput |
535 | 498 | { |
536 | 499 | public: |
|
0 commit comments