Use CCoinControl selection in CWallet::FundTransaction
[bitcoinplatinum.git] / src / coincontrol.h
blob12fe9ce219c272a5d3c5b78339d52a83645eb424
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;
22 CCoinControl()
24 SetNull();
27 void SetNull()
29 destChange = CNoDestination();
30 fAllowOtherInputs = false;
31 fAllowWatchOnly = false;
32 setSelected.clear();
33 nMinimumTotalFee = 0;
36 bool HasSelected() const
38 return (setSelected.size() > 0);
41 bool IsSelected(const COutPoint& output) const
43 return (setSelected.count(output) > 0);
46 void Select(const COutPoint& output)
48 setSelected.insert(output);
51 void UnSelect(const COutPoint& output)
53 setSelected.erase(output);
56 void UnSelectAll()
58 setSelected.clear();
61 void ListSelected(std::vector<COutPoint>& vOutpoints) const
63 vOutpoints.assign(setSelected.begin(), setSelected.end());
66 private:
67 std::set<COutPoint> setSelected;
70 #endif // BITCOIN_COINCONTROL_H