Merge #8980: RPC: importmulti: Avoid using boost::variant::operator!=, which is only...
[bitcoinplatinum.git] / src / coincontrol.h
blobe33adc4d2b00c480555edac9d590167e2ef2f075
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. */
11 class CCoinControl
13 public:
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
18 bool fAllowWatchOnly;
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
24 CFeeRate nFeeRate;
26 CCoinControl()
28 SetNull();
31 void SetNull()
33 destChange = CNoDestination();
34 fAllowOtherInputs = false;
35 fAllowWatchOnly = false;
36 setSelected.clear();
37 nMinimumTotalFee = 0;
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);
62 void UnSelectAll()
64 setSelected.clear();
67 void ListSelected(std::vector<COutPoint>& vOutpoints) const
69 vOutpoints.assign(setSelected.begin(), setSelected.end());
72 private:
73 std::set<COutPoint> setSelected;
76 #endif // BITCOIN_COINCONTROL_H