From 1ae5839ff024096c65e1590084f2720fa08d3e23 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 21 Oct 2016 11:47:10 +0200 Subject: moveonly: move `coincontrol` to `src/wallet` --- src/Makefile.am | 2 +- src/coincontrol.h | 76 -------------------------------------------- src/qt/coincontroldialog.cpp | 2 +- src/qt/sendcoinsdialog.cpp | 2 +- src/wallet/coincontrol.h | 76 ++++++++++++++++++++++++++++++++++++++++++++ src/wallet/wallet.cpp | 2 +- 6 files changed, 80 insertions(+), 80 deletions(-) delete mode 100644 src/coincontrol.h create mode 100644 src/wallet/coincontrol.h (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index e7f1d82b8b..ab3104ec63 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -87,7 +87,6 @@ BITCOIN_CORE_H = \ checkpoints.h \ checkqueue.h \ clientversion.h \ - coincontrol.h \ coins.h \ compat.h \ compat/byteswap.h \ @@ -147,6 +146,7 @@ BITCOIN_CORE_H = \ utiltime.h \ validationinterface.h \ versionbits.h \ + wallet/coincontrol.h \ wallet/crypter.h \ wallet/db.h \ wallet/rpcwallet.h \ diff --git a/src/coincontrol.h b/src/coincontrol.h deleted file mode 100644 index e33adc4d2b..0000000000 --- a/src/coincontrol.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2011-2015 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_COINCONTROL_H -#define BITCOIN_COINCONTROL_H - -#include "primitives/transaction.h" - -/** Coin Control Features. */ -class CCoinControl -{ -public: - CTxDestination destChange; - //! If false, allows unselected inputs, but requires all selected inputs be used - bool fAllowOtherInputs; - //! Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE criteria - bool fAllowWatchOnly; - //! Minimum absolute fee (not per kilobyte) - CAmount nMinimumTotalFee; - //! Override estimated feerate - bool fOverrideFeeRate; - //! Feerate to use if overrideFeeRate is true - CFeeRate nFeeRate; - - CCoinControl() - { - SetNull(); - } - - void SetNull() - { - destChange = CNoDestination(); - fAllowOtherInputs = false; - fAllowWatchOnly = false; - setSelected.clear(); - nMinimumTotalFee = 0; - nFeeRate = CFeeRate(0); - fOverrideFeeRate = false; - } - - bool HasSelected() const - { - return (setSelected.size() > 0); - } - - bool IsSelected(const COutPoint& output) const - { - return (setSelected.count(output) > 0); - } - - void Select(const COutPoint& output) - { - setSelected.insert(output); - } - - void UnSelect(const COutPoint& output) - { - setSelected.erase(output); - } - - void UnSelectAll() - { - setSelected.clear(); - } - - void ListSelected(std::vector& vOutpoints) const - { - vOutpoints.assign(setSelected.begin(), setSelected.end()); - } - -private: - std::set setSelected; -}; - -#endif // BITCOIN_COINCONTROL_H diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 86fd4ebd65..1a1671f0ee 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -13,7 +13,7 @@ #include "txmempool.h" #include "walletmodel.h" -#include "coincontrol.h" +#include "wallet/coincontrol.h" #include "init.h" #include "main.h" // For minRelayTxFee #include "wallet/wallet.h" diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 4b2ba7d624..f1c867e6f8 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -16,7 +16,7 @@ #include "walletmodel.h" #include "base58.h" -#include "coincontrol.h" +#include "wallet/coincontrol.h" #include "main.h" // mempool and minRelayTxFee #include "ui_interface.h" #include "txmempool.h" diff --git a/src/wallet/coincontrol.h b/src/wallet/coincontrol.h new file mode 100644 index 0000000000..78516770e6 --- /dev/null +++ b/src/wallet/coincontrol.h @@ -0,0 +1,76 @@ +// Copyright (c) 2011-2015 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_WALLET_COINCONTROL_H +#define BITCOIN_WALLET_COINCONTROL_H + +#include "primitives/transaction.h" + +/** Coin Control Features. */ +class CCoinControl +{ +public: + CTxDestination destChange; + //! If false, allows unselected inputs, but requires all selected inputs be used + bool fAllowOtherInputs; + //! Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE criteria + bool fAllowWatchOnly; + //! Minimum absolute fee (not per kilobyte) + CAmount nMinimumTotalFee; + //! Override estimated feerate + bool fOverrideFeeRate; + //! Feerate to use if overrideFeeRate is true + CFeeRate nFeeRate; + + CCoinControl() + { + SetNull(); + } + + void SetNull() + { + destChange = CNoDestination(); + fAllowOtherInputs = false; + fAllowWatchOnly = false; + setSelected.clear(); + nMinimumTotalFee = 0; + nFeeRate = CFeeRate(0); + fOverrideFeeRate = false; + } + + bool HasSelected() const + { + return (setSelected.size() > 0); + } + + bool IsSelected(const COutPoint& output) const + { + return (setSelected.count(output) > 0); + } + + void Select(const COutPoint& output) + { + setSelected.insert(output); + } + + void UnSelect(const COutPoint& output) + { + setSelected.erase(output); + } + + void UnSelectAll() + { + setSelected.clear(); + } + + void ListSelected(std::vector& vOutpoints) const + { + vOutpoints.assign(setSelected.begin(), setSelected.end()); + } + +private: + std::set setSelected; +}; + +#endif // BITCOIN_WALLET_COINCONTROL_H diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index c7f98b238e..60a769704b 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -8,7 +8,7 @@ #include "base58.h" #include "checkpoints.h" #include "chain.h" -#include "coincontrol.h" +#include "wallet/coincontrol.h" #include "consensus/consensus.h" #include "consensus/validation.h" #include "key.h" -- cgit v1.2.3