Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coincontrol.h
Go to the documentation of this file.
1 #ifndef COINCONTROL_H
2 #define COINCONTROL_H
3 
6 {
7 public:
9 
11  {
12  SetNull();
13  }
14 
15  void SetNull()
16  {
17  destChange = CNoDestination();
18  setSelected.clear();
19  }
20 
21  bool HasSelected() const
22  {
23  return (setSelected.size() > 0);
24  }
25 
26  bool IsSelected(const uint256& hash, unsigned int n) const
27  {
28  COutPoint outpt(hash, n);
29  return (setSelected.count(outpt) > 0);
30  }
31 
32  void Select(COutPoint& output)
33  {
34  setSelected.insert(output);
35  }
36 
37  void UnSelect(COutPoint& output)
38  {
39  setSelected.erase(output);
40  }
41 
42  void UnSelectAll()
43  {
44  setSelected.clear();
45  }
46 
47  void ListSelected(std::vector<COutPoint>& vOutpoints)
48  {
49  vOutpoints.assign(setSelected.begin(), setSelected.end());
50  }
51 
52 private:
53  std::set<COutPoint> setSelected;
54 
55 };
56 
57 #endif // COINCONTROL_H
bool IsSelected(const uint256 &hash, unsigned int n) const
Definition: coincontrol.h:26
Coin Control Features.
Definition: coincontrol.h:5
std::set< COutPoint > setSelected
Definition: coincontrol.h:53
void SetNull()
Definition: coincontrol.h:15
CTxDestination destChange
Definition: coincontrol.h:8
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: main.h:278
void UnSelectAll()
Definition: coincontrol.h:42
256-bit unsigned integer
Definition: uint256.h:537
void Select(COutPoint &output)
Definition: coincontrol.h:32
void ListSelected(std::vector< COutPoint > &vOutpoints)
Definition: coincontrol.h:47
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
Definition: script.h:62
void UnSelect(COutPoint &output)
Definition: coincontrol.h:37
uint32_t hash
Definition: cache.cc:34
bool HasSelected() const
Definition: coincontrol.h:21