Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
coincontrol.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef COINCONTROL_H
6 #define COINCONTROL_H
7 
8 #include "core.h"
9 
12 {
13 public:
15 
17  {
18  SetNull();
19  }
20 
21  void SetNull()
22  {
23  destChange = CNoDestination();
24  setSelected.clear();
25  }
26 
27  bool HasSelected() const
28  {
29  return (setSelected.size() > 0);
30  }
31 
32  bool IsSelected(const uint256& hash, unsigned int n) const
33  {
34  COutPoint outpt(hash, n);
35  return (setSelected.count(outpt) > 0);
36  }
37 
38  void Select(COutPoint& output)
39  {
40  setSelected.insert(output);
41  }
42 
43  void UnSelect(COutPoint& output)
44  {
45  setSelected.erase(output);
46  }
47 
48  void UnSelectAll()
49  {
50  setSelected.clear();
51  }
52 
53  void ListSelected(std::vector<COutPoint>& vOutpoints)
54  {
55  vOutpoints.assign(setSelected.begin(), setSelected.end());
56  }
57 
58 private:
59  std::set<COutPoint> setSelected;
60 
61 };
62 
63 #endif // COINCONTROL_H
bool IsSelected(const uint256 &hash, unsigned int n) const
Definition: coincontrol.h:32
Coin Control Features.
Definition: coincontrol.h:11
std::set< COutPoint > setSelected
Definition: coincontrol.h:59
void SetNull()
Definition: coincontrol.h:21
CTxDestination destChange
Definition: coincontrol.h:14
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: core.h:22
void UnSelectAll()
Definition: coincontrol.h:48
256-bit unsigned integer
Definition: uint256.h:531
void Select(COutPoint &output)
Definition: coincontrol.h:38
void ListSelected(std::vector< COutPoint > &vOutpoints)
Definition: coincontrol.h:53
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
Definition: script.h:218
void UnSelect(COutPoint &output)
Definition: coincontrol.h:43
bool HasSelected() const
Definition: coincontrol.h:27