Fix ZMQ Notification initialization and shutdown
[bitcoinplatinum.git] / src / coincontrol.h
blobbc965f9e19dfa0a509801bab11bf632a210809b6
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. */
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;
20 CCoinControl()
22 SetNull();
25 void SetNull()
27 destChange = CNoDestination();
28 fAllowOtherInputs = false;
29 fAllowWatchOnly = false;
30 setSelected.clear();
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);
54 void UnSelectAll()
56 setSelected.clear();
59 void ListSelected(std::vector<COutPoint>& vOutpoints) const
61 vOutpoints.assign(setSelected.begin(), setSelected.end());
64 private:
65 std::set<COutPoint> setSelected;
68 #endif // BITCOIN_COINCONTROL_H