1 // Copyright (c) 2011-2013 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
27 destChange
= CNoDestination();
28 fAllowOtherInputs
= false;
29 fAllowWatchOnly
= false;
33 bool HasSelected() const
35 return (setSelected
.size() > 0);
38 bool IsSelected(const uint256
& hash
, unsigned int n
) const
40 COutPoint
outpt(hash
, n
);
41 return (setSelected
.count(outpt
) > 0);
44 void Select(const COutPoint
& output
)
46 setSelected
.insert(output
);
49 void UnSelect(const COutPoint
& output
)
51 setSelected
.erase(output
);
59 void ListSelected(std::vector
<COutPoint
>& vOutpoints
) const
61 vOutpoints
.assign(setSelected
.begin(), setSelected
.end());
65 std::set
<COutPoint
> setSelected
;
68 #endif // BITCOIN_COINCONTROL_H