BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
coincontrol.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2018 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_WALLET_COINCONTROL_H
6 #define BITCOIN_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:
22  boost::optional<OutputType> m_change_type;
30  boost::optional<CFeeRate> m_feerate;
32  boost::optional<unsigned int> m_confirm_target;
34  boost::optional<bool> m_signal_bip125_rbf;
39 
41  {
42  SetNull();
43  }
44 
45  void SetNull();
46 
47  bool HasSelected() const
48  {
49  return (setSelected.size() > 0);
50  }
51 
52  bool IsSelected(const COutPoint& output) const
53  {
54  return (setSelected.count(output) > 0);
55  }
56 
57  void Select(const COutPoint& output)
58  {
59  setSelected.insert(output);
60  }
61 
62  void UnSelect(const COutPoint& output)
63  {
64  setSelected.erase(output);
65  }
66 
67  void UnSelectAll()
68  {
69  setSelected.clear();
70  }
71 
72  void ListSelected(std::vector<COutPoint>& vOutpoints) const
73  {
74  vOutpoints.assign(setSelected.begin(), setSelected.end());
75  }
76 
77 private:
78  std::set<COutPoint> setSelected;
79 };
80 
81 #endif // BITCOIN_WALLET_COINCONTROL_H
bool fAllowWatchOnly
Includes watch only addresses which are solvable.
Definition: coincontrol.h:26
boost::optional< unsigned int > m_confirm_target
Override the default confirmation target if set.
Definition: coincontrol.h:32
FeeEstimateMode
Definition: fees.h:52
void ListSelected(std::vector< COutPoint > &vOutpoints) const
Definition: coincontrol.h:72
bool HasSelected() const
Definition: coincontrol.h:47
boost::optional< OutputType > m_change_type
Override the default change type if set, ignored if destChange is set.
Definition: coincontrol.h:22
void UnSelect(const COutPoint &output)
Definition: coincontrol.h:62
bool fOverrideFeeRate
Override automatic min/max checks on fee, m_feerate must be set if true.
Definition: coincontrol.h:28
Coin Control Features.
Definition: coincontrol.h:16
boost::optional< CFeeRate > m_feerate
Override the wallet&#39;s m_pay_tx_fee if set.
Definition: coincontrol.h:30
bool m_avoid_partial_spends
Avoid partial use of funds sent to a given address.
Definition: coincontrol.h:36
std::set< COutPoint > setSelected
Definition: coincontrol.h:78
boost::variant< CNoDestination, CKeyID, CScriptID, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:123
void SetNull()
Definition: coincontrol.cpp:9
CTxDestination destChange
Custom change destination, if not set an address is generated.
Definition: coincontrol.h:20
void Select(const COutPoint &output)
Definition: coincontrol.h:57
bool fAllowOtherInputs
If false, allows unselected inputs, but requires all selected inputs be used.
Definition: coincontrol.h:24
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:18
boost::optional< bool > m_signal_bip125_rbf
Override the wallet&#39;s m_signal_rbf if set.
Definition: coincontrol.h:34
void UnSelectAll()
Definition: coincontrol.h:67
bool IsSelected(const COutPoint &output) const
Definition: coincontrol.h:52
FeeEstimateMode m_fee_mode
Fee estimation mode to control arguments to estimateSmartFee.
Definition: coincontrol.h:38