Update CMakeLists.txt - play with openssl
[novacoin.git] / src / coincontrol.cpp
1 #include "coincontrol.h"
2 #include "wallet.h"
3
4 CCoinControl::CCoinControl()
5 {
6     SetNull();
7 }
8
9 void CCoinControl::SetNull()
10 {
11     destChange = CBitcoinAddress();
12     setSelected.clear();
13 }
14
15 bool CCoinControl::HasSelected() const
16 {
17     return (setSelected.size() > 0);
18 }
19
20 bool CCoinControl::IsSelected(const uint256 &hash, unsigned int n) const
21 {
22     COutPoint outpt(hash, n);
23     return (setSelected.count(outpt) > 0);
24 }
25
26 void CCoinControl::Select(COutPoint &output)
27 {
28     setSelected.insert(output);
29 }
30
31 void CCoinControl::UnSelect(COutPoint &output)
32 {
33     setSelected.erase(output);
34 }
35
36 void CCoinControl::UnSelectAll()
37 {
38     setSelected.clear();
39 }
40
41 void CCoinControl::ListSelected(std::vector<COutPoint> &vOutpoints)
42 {
43     vOutpoints.assign(setSelected.begin(), setSelected.end());
44 }