1 // Copyright (c) 2011-2015 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef BITCOIN_COINCONTROL_H
6 #define BITCOIN_COINCONTROL_H
8 #include "primitives/transaction.h"
10 /** Coin Control Features. */
14 CTxDestination destChange
;
15 //! If false, allows unselected inputs, but requires all selected inputs be used
16 bool fAllowOtherInputs
;
17 //! Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE criteria
19 //! Minimum absolute fee (not per kilobyte)
20 CAmount nMinimumTotalFee
;
21 //! Override estimated feerate
22 bool fOverrideFeeRate
;
23 //! Feerate to use if overrideFeeRate is true
33 destChange
= CNoDestination();
34 fAllowOtherInputs
= false;
35 fAllowWatchOnly
= false;
38 nFeeRate
= CFeeRate(0);
39 fOverrideFeeRate
= false;
42 bool HasSelected() const
44 return (setSelected
.size() > 0);
47 bool IsSelected(const COutPoint
& output
) const
49 return (setSelected
.count(output
) > 0);
52 void Select(const COutPoint
& output
)
54 setSelected
.insert(output
);
57 void UnSelect(const COutPoint
& output
)
59 setSelected
.erase(output
);
67 void ListSelected(std::vector
<COutPoint
>& vOutpoints
) const
69 vOutpoints
.assign(setSelected
.begin(), setSelected
.end());
73 std::set
<COutPoint
> setSelected
;
76 #endif // BITCOIN_COINCONTROL_H