mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-11 15:19:19 +02:00
Merge #17316: refactor: Replace all uses of boost::optional with our own Optional type
d314e8a818refactor: Replace all uses of boost::optional with our own Optional type (Wladimir J. van der Laan) Pull request description: Replace all uses of boost::optional with our own Optional type. Luckily, there aren't so many. After this: - `boost::optional` is no longer used directly (only through `Optional` which is an alias for it) - `boost/optional.hpp` is only included in one place ACKs for top commit: MarcoFalke: ACKd314e8a818practicalswift: ACKd314e8a818-- diff looks correct + satisfying to see incremental progress towards the goal of a Boost free future :) jtimon: ACKd314e8a818fanquake: ACKd314e8a818Tree-SHA512: b43e0017af81b07b5851377cd09624f114510ac5b9018d037664b58ad0fc8e893e30946b61f8f5e21e39125925bf9998a81f2226b468aab2df653ee57ed3213d
This commit is contained in:
@@ -5,13 +5,12 @@
|
||||
#ifndef BITCOIN_WALLET_COINCONTROL_H
|
||||
#define BITCOIN_WALLET_COINCONTROL_H
|
||||
|
||||
#include <optional.h>
|
||||
#include <policy/feerate.h>
|
||||
#include <policy/fees.h>
|
||||
#include <primitives/transaction.h>
|
||||
#include <wallet/wallet.h>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
const int DEFAULT_MIN_DEPTH = 0;
|
||||
const int DEFAULT_MAX_DEPTH = 9999999;
|
||||
|
||||
@@ -22,7 +21,7 @@ public:
|
||||
//! Custom change destination, if not set an address is generated
|
||||
CTxDestination destChange;
|
||||
//! Override the default change type if set, ignored if destChange is set
|
||||
boost::optional<OutputType> m_change_type;
|
||||
Optional<OutputType> m_change_type;
|
||||
//! If false, allows unselected inputs, but requires all selected inputs be used
|
||||
bool fAllowOtherInputs;
|
||||
//! Includes watch only addresses which are solvable
|
||||
@@ -30,11 +29,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<CFeeRate> m_feerate;
|
||||
Optional<CFeeRate> m_feerate;
|
||||
//! Override the default confirmation target if set
|
||||
boost::optional<unsigned int> m_confirm_target;
|
||||
Optional<unsigned int> m_confirm_target;
|
||||
//! Override the wallet's m_signal_rbf if set
|
||||
boost::optional<bool> m_signal_bip125_rbf;
|
||||
Optional<bool> 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
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
|
||||
#include <wallet/coinselection.h>
|
||||
|
||||
#include <optional.h>
|
||||
#include <util/system.h>
|
||||
#include <util/moneystr.h>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
// Descending order comparator
|
||||
struct {
|
||||
bool operator()(const OutputGroup& a, const OutputGroup& b) const
|
||||
@@ -219,7 +218,7 @@ bool KnapsackSolver(const CAmount& nTargetValue, std::vector<OutputGroup>& group
|
||||
nValueRet = 0;
|
||||
|
||||
// List of values less than target
|
||||
boost::optional<OutputGroup> lowest_larger;
|
||||
Optional<OutputGroup> lowest_larger;
|
||||
std::vector<OutputGroup> applicable_groups;
|
||||
CAmount nTotalLower = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user