Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/coincontrol.h
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_WALLET_COINCONTROL_H | #ifndef BITCOIN_WALLET_COINCONTROL_H | ||||
#define BITCOIN_WALLET_COINCONTROL_H | #define BITCOIN_WALLET_COINCONTROL_H | ||||
#include "primitives/transaction.h" | #include "primitives/transaction.h" | ||||
#include <boost/optional.hpp> | |||||
/** Coin Control Features. */ | /** Coin Control Features. */ | ||||
class CCoinControl { | class CCoinControl { | ||||
public: | public: | ||||
CTxDestination destChange; | CTxDestination destChange; | ||||
//! If false, allows unselected inputs, but requires all selected inputs be | //! If false, allows unselected inputs, but requires all selected inputs be | ||||
//! used | //! used | ||||
bool fAllowOtherInputs; | bool fAllowOtherInputs; | ||||
//! Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE | //! Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE | ||||
//! criteria | //! criteria | ||||
bool fAllowWatchOnly; | bool fAllowWatchOnly; | ||||
//! Override estimated feerate | //! Override automatic min/max checks on fee, m_feerate must be set if true | ||||
bool fOverrideFeeRate; | bool fOverrideFeeRate; | ||||
//! Feerate to use if overrideFeeRate is true | //! Override the default payTxFee if set | ||||
CFeeRate nFeeRate; | boost::optional<CFeeRate> m_feerate; | ||||
//! Override the default confirmation target, 0 = use default | //! Override the default confirmation target if set | ||||
int nConfirmTarget; | boost::optional<unsigned int> m_confirm_target; | ||||
Fabien: This can likely be removed | |||||
jasonbcoxAuthorUnsubmitted Done Inline ActionsI'm leaving it in for now to reduce merge conflicts, but yes it can be removed as it's effectively unused (similar to labelSmartFee). jasonbcox: I'm leaving it in for now to reduce merge conflicts, but yes it can be removed as it's… | |||||
CCoinControl() { SetNull(); } | CCoinControl() { SetNull(); } | ||||
void SetNull() { | void SetNull() { | ||||
destChange = CNoDestination(); | destChange = CNoDestination(); | ||||
fAllowOtherInputs = false; | fAllowOtherInputs = false; | ||||
fAllowWatchOnly = false; | fAllowWatchOnly = false; | ||||
setSelected.clear(); | setSelected.clear(); | ||||
nFeeRate = CFeeRate(Amount::zero()); | m_feerate.reset(); | ||||
fOverrideFeeRate = false; | fOverrideFeeRate = false; | ||||
nConfirmTarget = 0; | m_confirm_target.reset(); | ||||
FabienUnsubmitted Not Done Inline Actionsdito Fabien: dito | |||||
} | } | ||||
bool HasSelected() const { return (setSelected.size() > 0); } | bool HasSelected() const { return (setSelected.size() > 0); } | ||||
bool IsSelected(const COutPoint &output) const { | bool IsSelected(const COutPoint &output) const { | ||||
return (setSelected.count(output) > 0); | return (setSelected.count(output) > 0); | ||||
} | } | ||||
Show All 15 Lines |
This can likely be removed