diff --git a/src/psbt.h b/src/psbt.h index 13a2ff2ad8..3a734bdfc3 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -645,7 +645,7 @@ struct PSBTOutput /** A version of CTransaction with the PSBT format*/ struct PartiallySignedTransaction { - boost::optional tx; + Optional tx; std::vector inputs; std::vector outputs; std::map, std::vector> unknown; diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 67666bec08..30c050f5af 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -158,7 +159,7 @@ bool CTxMemPool::CalculateMemPoolAncestors(const CTxMemPoolEntry &entry, setEntr // GetMemPoolParents() is only valid for entries in the mempool, so we // iterate mapTx to find parents. for (unsigned int i = 0; i < tx.vin.size(); i++) { - boost::optional piter = GetIter(tx.vin[i].prevout.hash); + Optional piter = GetIter(tx.vin[i].prevout.hash); if (piter) { parentHashes.insert(*piter); if (parentHashes.size() + 1 > limitAncestorCount) { @@ -937,11 +938,11 @@ const CTransaction* CTxMemPool::GetConflictTx(const COutPoint& prevout) const return it == mapNextTx.end() ? nullptr : it->second; } -boost::optional CTxMemPool::GetIter(const uint256& txid) const +Optional CTxMemPool::GetIter(const uint256& txid) const { auto it = mapTx.find(txid); if (it != mapTx.end()) return it; - return boost::optional{}; + return Optional{}; } CTxMemPool::setEntries CTxMemPool::GetIterSet(const std::set& hashes) const diff --git a/src/txmempool.h b/src/txmempool.h index 50d2fb5802..6a7bc15973 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -608,7 +609,7 @@ public: const CTransaction* GetConflictTx(const COutPoint& prevout) const EXCLUSIVE_LOCKS_REQUIRED(cs); /** Returns an iterator to the given hash, if found */ - boost::optional GetIter(const uint256& txid) const EXCLUSIVE_LOCKS_REQUIRED(cs); + Optional GetIter(const uint256& txid) const EXCLUSIVE_LOCKS_REQUIRED(cs); /** Translate a set of hashes into a set of pool iterators to avoid repeated lookups */ setEntries GetIterSet(const std::set& hashes) const EXCLUSIVE_LOCKS_REQUIRED(cs); diff --git a/src/wallet/coincontrol.h b/src/wallet/coincontrol.h index 00161ca76e..6a08d6dce6 100644 --- a/src/wallet/coincontrol.h +++ b/src/wallet/coincontrol.h @@ -6,13 +6,12 @@ #define BITCOIN_WALLET_COINCONTROL_H #include +#include #include #include #include #include -#include - const int DEFAULT_MIN_DEPTH = 0; const int DEFAULT_MAX_DEPTH = 9999999; @@ -23,7 +22,7 @@ public: //! Custom change destination, if not set an address is generated std::map destChange; //! Override the default change type if set, ignored if destChange is set - boost::optional m_change_type; + Optional m_change_type; //! If false, allows unselected inputs, but requires all selected inputs be used bool fAllowOtherInputs; //! Includes watch only addresses which are solvable @@ -31,11 +30,11 @@ public: //! Override automatic min/max checks on fee, m_feerate must be set if true bool fOverrideFeeRate; //! Override the wallet's m_pay_tx_fee if set - boost::optional m_feerate; + Optional m_feerate; //! Override the default confirmation target if set - boost::optional m_confirm_target; + Optional m_confirm_target; //! Override the wallet's m_signal_rbf if set - boost::optional m_signal_bip125_rbf; + Optional m_signal_bip125_rbf; //! Avoid partial use of funds sent to a given address bool m_avoid_partial_spends; //! Forbids inclusion of dirty (previously used) addresses diff --git a/src/wallet/coinselection.cpp b/src/wallet/coinselection.cpp index 725cc2c76c..f908246395 100644 --- a/src/wallet/coinselection.cpp +++ b/src/wallet/coinselection.cpp @@ -5,11 +5,10 @@ #include #include +#include #include #include -#include - CInputCoin::CInputCoin(const CWalletTx* wtx, unsigned int i) { if (!wtx || !wtx->tx) throw std::invalid_argument("tx should not be null"); @@ -291,7 +290,7 @@ bool KnapsackSolver(const CAmount& nTargetValue, std::vector& group nValueRet = 0; // List of values less than target - boost::optional lowest_larger; + Optional lowest_larger; std::vector applicable_groups; CAmount nTotalLower = 0;