From 57e980d13ca488031bde6ef197cf34d493d36796 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 15 Mar 2021 10:41:30 +0800 Subject: scripted-diff: remove Optional & nullopt -BEGIN VERIFY SCRIPT- git rm src/optional.h sed -i -e 's/Optional/d' src/test/fuzz/autofile.cpp src/test/fuzz/buffered_file.cpp src/test/fuzz/node_eviction.cpp sed -i -e 's/#include /#include /g' $(git grep -l '#include ' src) -END VERIFY SCRIPT- --- src/wallet/rpcwallet.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/wallet/rpcwallet.cpp') diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 8b0962f9ee..cf71f1e163 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -219,7 +219,7 @@ static void SetFeeEstimateMode(const CWallet& wallet, CCoinControl& cc, const Un cc.m_feerate = CFeeRate(AmountFromValue(fee_rate), COIN); if (override_min_fee) cc.fOverrideFeeRate = true; // Default RBF to true for explicit fee_rate, if unset. - if (cc.m_signal_bip125_rbf == nullopt) cc.m_signal_bip125_rbf = true; + if (cc.m_signal_bip125_rbf == std::nullopt) cc.m_signal_bip125_rbf = true; return; } if (!estimate_mode.isNull() && !FeeModeFromString(estimate_mode.get_str(), cc.m_fee_mode)) { @@ -1564,8 +1564,8 @@ static RPCHelpMan listsinceblock() LOCK(wallet.cs_wallet); - Optional height; // Height of the specified block or the common ancestor, if the block provided was in a deactivated chain. - Optional altheight; // Height of the specified block, even if it's in a deactivated chain. + std::optional height; // Height of the specified block or the common ancestor, if the block provided was in a deactivated chain. + std::optional altheight; // Height of the specified block, even if it's in a deactivated chain. int target_confirms = 1; isminefilter filter = ISMINE_SPENDABLE; @@ -2590,7 +2590,7 @@ static RPCHelpMan loadwallet() options.require_existing = true; bilingual_str error; std::vector warnings; - Optional load_on_start = request.params[1].isNull() ? nullopt : Optional(request.params[1].get_bool()); + std::optional load_on_start = request.params[1].isNull() ? std::nullopt : std::optional(request.params[1].get_bool()); std::shared_ptr const wallet = LoadWallet(*context.chain, name, load_on_start, options, status, error, warnings); if (!wallet) { // Map bad format to not found, since bad format is returned when the @@ -2764,7 +2764,7 @@ static RPCHelpMan createwallet() options.create_flags = flags; options.create_passphrase = passphrase; bilingual_str error; - Optional load_on_start = request.params[6].isNull() ? nullopt : Optional(request.params[6].get_bool()); + std::optional load_on_start = request.params[6].isNull() ? std::nullopt : std::optional(request.params[6].get_bool()); std::shared_ptr wallet = CreateWallet(*context.chain, request.params[0].get_str(), load_on_start, options, status, error, warnings); if (!wallet) { RPCErrorCode code = status == DatabaseStatus::FAILED_ENCRYPT ? RPC_WALLET_ENCRYPTION_FAILED : RPC_WALLET_ERROR; @@ -2816,7 +2816,7 @@ static RPCHelpMan unloadwallet() // Note that any attempt to load the same wallet would fail until the wallet // is destroyed (see CheckUniqueFileid). std::vector warnings; - Optional load_on_start = request.params[1].isNull() ? nullopt : Optional(request.params[1].get_bool()); + std::optional load_on_start = request.params[1].isNull() ? std::nullopt : std::optional(request.params[1].get_bool()); if (!RemoveWallet(wallet, load_on_start, warnings)) { throw JSONRPCError(RPC_MISC_ERROR, "Requested wallet already unloaded"); } @@ -3587,7 +3587,7 @@ static RPCHelpMan rescanblockchain() } int start_height = 0; - Optional stop_height; + std::optional stop_height; uint256 start_block; { LOCK(pwallet->cs_wallet); -- cgit v1.2.3