Fabcoin Core  0.16.2
P2P Digital Currency
coincontrol.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2017 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 FABCOIN_WALLET_COINCONTROL_H
6 #define FABCOIN_WALLET_COINCONTROL_H
7 
8 #include <policy/feerate.h>
9 #include <policy/fees.h>
10 #include <primitives/transaction.h>
11 #include <wallet/wallet.h>
12 
13 #include <boost/optional.hpp>
14 
17 {
18 public:
27  boost::optional<CFeeRate> m_feerate;
29  boost::optional<unsigned int> m_confirm_target;
31  bool signalRbf;
34 
36  {
37  SetNull();
38  }
39 
40  void SetNull()
41  {
42  destChange = CNoDestination();
43  fAllowOtherInputs = false;
44  fAllowWatchOnly = false;
45  setSelected.clear();
46  m_feerate.reset();
47  fOverrideFeeRate = false;
48  m_confirm_target.reset();
49  signalRbf = fWalletRbf;
50  m_fee_mode = FeeEstimateMode::UNSET;
51  }
52 
53  bool HasSelected() const
54  {
55  return (setSelected.size() > 0);
56  }
57 
58  bool IsSelected(const COutPoint& output) const
59  {
60  return (setSelected.count(output) > 0);
61  }
62 
63  void Select(const COutPoint& output)
64  {
65  setSelected.insert(output);
66  }
67 
68  void UnSelect(const COutPoint& output)
69  {
70  setSelected.erase(output);
71  }
72 
73  void UnSelectAll()
74  {
75  setSelected.clear();
76  }
77 
78  void ListSelected(std::vector<COutPoint>& vOutpoints) const
79  {
80  vOutpoints.assign(setSelected.begin(), setSelected.end());
81  }
82 
83 private:
84  std::set<COutPoint> setSelected;
85 };
86 
87 #endif // FABCOIN_WALLET_COINCONTROL_H
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:79
bool fAllowWatchOnly
Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE criteria.
Definition: coincontrol.h:23
boost::optional< unsigned int > m_confirm_target
Override the default confirmation target if set.
Definition: coincontrol.h:29
FeeEstimateMode
Definition: fees.h:96
void ListSelected(std::vector< COutPoint > &vOutpoints) const
Definition: coincontrol.h:78
void UnSelect(const COutPoint &output)
Definition: coincontrol.h:68
bool fOverrideFeeRate
Override automatic min/max checks on fee, m_feerate must be set if true.
Definition: coincontrol.h:25
Coin Control Features.
Definition: coincontrol.h:16
boost::optional< CFeeRate > m_feerate
Override the default payTxFee if set.
Definition: coincontrol.h:27
std::set< COutPoint > setSelected
Definition: coincontrol.h:84
bool signalRbf
Signal BIP-125 replace by fee.
Definition: coincontrol.h:31
bool fWalletRbf
Definition: wallet.cpp:47
void SetNull()
Definition: coincontrol.h:40
CTxDestination destChange
Definition: coincontrol.h:19
void Select(const COutPoint &output)
Definition: coincontrol.h:63
bool fAllowOtherInputs
If false, allows unselected inputs, but requires all selected inputs be used.
Definition: coincontrol.h:21
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:18
void UnSelectAll()
Definition: coincontrol.h:73
FeeEstimateMode m_fee_mode
Fee estimation mode to control arguments to estimateSmartFee.
Definition: coincontrol.h:33
bool IsSelected(const COutPoint &output) const
Definition: coincontrol.h:58
bool HasSelected() const
Definition: coincontrol.h:53