1 // Copyright (c) 2011-2013 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or https://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;
25 destChange = CNoDestination();
26 fAllowOtherInputs = false;
30 bool HasSelected() const
32 return (setSelected.size() > 0);
35 bool IsSelected(const uint256& hash, unsigned int n) const
37 COutPoint outpt(hash, n);
38 return (setSelected.count(outpt) > 0);
41 void Select(const COutPoint& output)
43 setSelected.insert(output);
46 void UnSelect(const COutPoint& output)
48 setSelected.erase(output);
56 void ListSelected(std::vector<COutPoint>& vOutpoints) const
58 vOutpoints.assign(setSelected.begin(), setSelected.end());
62 std::set<COutPoint> setSelected;
65 #endif // BITCOIN_COINCONTROL_H