Dash Core  0.12.2.1
P2P Digital Currency
coincontrol.h
Go to the documentation of this file.
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.
4 
5 #ifndef BITCOIN_COINCONTROL_H
6 #define BITCOIN_COINCONTROL_H
7 
9 
12 {
13 public:
23 
25  {
26  SetNull();
27  }
28 
29  void SetNull()
30  {
32  fAllowOtherInputs = false;
33  fAllowWatchOnly = false;
34  setSelected.clear();
35  fUseInstantSend = false;
36  fUsePrivateSend = true;
37  nMinimumTotalFee = 0;
38  }
39 
40  bool HasSelected() const
41  {
42  return (setSelected.size() > 0);
43  }
44 
45  bool IsSelected(const COutPoint& output) const
46  {
47  return (setSelected.count(output) > 0);
48  }
49 
50  void Select(const COutPoint& output)
51  {
52  setSelected.insert(output);
53  }
54 
55  void UnSelect(const COutPoint& output)
56  {
57  setSelected.erase(output);
58  }
59 
60  void UnSelectAll()
61  {
62  setSelected.clear();
63  }
64 
65  void ListSelected(std::vector<COutPoint>& vOutpoints) const
66  {
67  vOutpoints.assign(setSelected.begin(), setSelected.end());
68  }
69 
70 private:
71  std::set<COutPoint> setSelected;
72 };
73 
74 #endif // BITCOIN_COINCONTROL_H
CTxDestination destChange
Definition: coincontrol.h:14
bool fAllowWatchOnly
Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE criteria.
Definition: coincontrol.h:20
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
Definition: standard.h:69
bool IsSelected(const COutPoint &output) const
Definition: coincontrol.h:45
bool HasSelected() const
Definition: coincontrol.h:40
void Select(const COutPoint &output)
Definition: coincontrol.h:50
bool fUseInstantSend
Definition: coincontrol.h:16
void SetNull()
Definition: coincontrol.h:29
void ListSelected(std::vector< COutPoint > &vOutpoints) const
Definition: coincontrol.h:65
int64_t CAmount
Definition: amount.h:14
std::set< COutPoint > setSelected
Definition: coincontrol.h:71
bool fAllowOtherInputs
If false, allows unselected inputs, but requires all selected inputs be used.
Definition: coincontrol.h:18
CAmount nMinimumTotalFee
Minimum absolute fee (not per kilobyte)
Definition: coincontrol.h:22
void UnSelectAll()
Definition: coincontrol.h:60
void UnSelect(const COutPoint &output)
Definition: coincontrol.h:55
bool fUsePrivateSend
Definition: coincontrol.h:15